Fix bug in Python 3 lambda expression handling

Some other small cleanup changes
This commit is contained in:
rocky
2016-05-15 18:14:22 -04:00
parent bb31629c35
commit 2c121545f0
6 changed files with 27 additions and 8 deletions

View File

@@ -43,12 +43,15 @@ class Scanner3(scan.Scanner):
## FIXME opnames should be passed in here
def __init__(self, version):
self.version = version
self.opnames = {} # will eventually get passed in
scan.Scanner.__init__(self, version)
## FIXME opnames should be moved to init
def disassemble3(self, co, opnames, classname=None, code_objects={}):
self.opnames = opnames # will eventually disasppear
# import dis; dis.disassemble(co) # DEBUG
# Container for tokens
@@ -829,7 +832,9 @@ class Scanner3(scan.Scanner):
if __name__ == "__main__":
import inspect
co = inspect.currentframe().f_code
tokens, customize = Scanner3().disassemble_generic(co)
from uncompyle6 import PYTHON_VERSION
from opcode import opname
tokens, customize = Scanner3(PYTHON_VERSION).disassemble3(co, opname)
for t in tokens:
print(t)
pass