Skip to content

Commit 39b7c8c

Browse files
author
lantis63
committed
Fixed a couple warnings pychecker found
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%4088
1 parent c093cb8 commit 39b7c8c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

inputstream.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def detectBOM(self, fp):
7373
}
7474

7575
## go to beginning of file and get the first 4 bytes
76-
oldFP = fp.tell()
7776
fp.seek(0)
7877
(byte1, byte2, byte3, byte4) = tuple(map(ord, fp.read(4)))
7978

@@ -85,7 +84,7 @@ def detectBOM(self, fp):
8584
bomDetection = bomDict.get((byte1, byte2, None, None))
8685

8786
## if BOM detected, we're done :-)
88-
fp.seek(0) # No BOM, return to the beginning of the file
87+
fp.seek(0)
8988
if bomDetection :
9089
return bomDetection
9190
return None

tokenizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ def consumeNumberEntity(self, isHex):
167167
If not present self.parser.parseError() is invoked.
168168
"""
169169

170-
range = string.digits
170+
allowed = string.digits
171171
radix = 10
172172
if isHex:
173-
range = string.hexdigits
173+
allowed = string.hexdigits
174174
radix = 16
175175

176176
char = u"\uFFFD"
@@ -179,7 +179,7 @@ def consumeNumberEntity(self, isHex):
179179
# Consume all the characters that are in range.
180180
c = self.consumeChar()
181181
#XXX Explicit check for EOF
182-
while c in range and c is not EOF:
182+
while c in allowed and c is not EOF:
183183
charStack.append(c)
184184
c = self.consumeChar()
185185

utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ def openStream(stream):
5858

5959
# Treat source as a string and make it into a file-like object
6060
import cStringIO as StringIO
61-
return StringIO.StringIO(str(source))
61+
return StringIO.StringIO(str(stream))

0 commit comments

Comments
 (0)