Fix a few pychecker warnings
Fixes https://github.com/behdad/fonttools/issues/58
diff --git a/Lib/fontTools/ttLib/tables/ttProgram.py b/Lib/fontTools/ttLib/tables/ttProgram.py
index 156e4a2..bdc14e8 100644
--- a/Lib/fontTools/ttLib/tables/ttProgram.py
+++ b/Lib/fontTools/ttLib/tables/ttProgram.py
@@ -193,7 +193,7 @@
_pushCountPat = re.compile(r"[A-Z][A-Z0-9]*\s*\[.*?\]\s*/\* ([0-9]*).*?\*/")
-def _skipWhite(data, pos, _whiteRE=_whiteRE):
+def _skipWhite(data, pos):
m = _whiteRE.match(data, pos)
newPos = m.regs[0][1]
assert newPos >= pos
@@ -267,16 +267,14 @@
assert name == "bytecode"
self.fromBytecode(readHex(content))
- def _assemble(self,
- skipWhite=_skipWhite, mnemonicDict=mnemonicDict,
- binary2num=binary2num):
+ def _assemble(self):
assembly = self.assembly
if isinstance(assembly, type([])):
assembly = ' '.join(assembly)
bytecode = []
push = bytecode.append
lenAssembly = len(assembly)
- pos = skipWhite(assembly, 0)
+ pos = _skipWhite(assembly, 0)
while pos < lenAssembly:
m = _tokenRE.match(assembly, pos)
if m is None:
@@ -302,7 +300,7 @@
push(op)
else:
args = []
- pos = skipWhite(assembly, pos)
+ pos = _skipWhite(assembly, pos)
while pos < lenAssembly:
m = _tokenRE.match(assembly, pos)
if m is None:
@@ -311,7 +309,7 @@
if number is None and comment is None:
break
pos = m.regs[0][1]
- pos = skipWhite(assembly, pos)
+ pos = _skipWhite(assembly, pos)
if comment is not None:
continue
args.append(int(number))
@@ -340,7 +338,7 @@
else:
for value in args:
push(value)
- pos = skipWhite(assembly, pos)
+ pos = _skipWhite(assembly, pos)
if bytecode:
assert max(bytecode) < 256 and min(bytecode) >= 0
@@ -353,7 +351,6 @@
numBytecode = len(bytecode)
while i < numBytecode:
op = bytecode[i]
- arg = 0
try:
mnemonic, argBits, argoffset = opcodeDict[op]
except KeyError: