You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
marshal.py: Python2 marshal code shouldn't try to turn a code object
into a string. parse3.py: handle both keyword and positional function calls. scanner34.py: Remove extra level of quoting in LOAD_CONST. Keyward handling now works cross Python 2/3. Some other spelling and doc fixes.
This commit is contained in:
@@ -34,6 +34,7 @@ class Scanner27(scan.Scanner):
|
||||
customize = {}
|
||||
Token = self.Token # shortcut
|
||||
self.code = array('B', co.co_code)
|
||||
|
||||
for i in self.op_range(0, len(self.code)):
|
||||
if self.code[i] in (RETURN_VALUE, END_FINALLY):
|
||||
n = i + 1
|
||||
@@ -127,6 +128,7 @@ class Scanner27(scan.Scanner):
|
||||
|
||||
op = self.code[offset]
|
||||
op_name = opname[op]
|
||||
|
||||
oparg = None; pattr = None
|
||||
if op >= HAVE_ARGUMENT:
|
||||
oparg = self.get_argument(offset) + extended_arg
|
||||
@@ -147,9 +149,9 @@ class Scanner27(scan.Scanner):
|
||||
op_name = 'LOAD_DICTCOMP'
|
||||
elif const.co_name == '<setcomp>':
|
||||
op_name = 'LOAD_SETCOMP'
|
||||
# verify uses 'pattr' for comparism, since 'attr'
|
||||
# verify() uses 'pattr' for comparison, since 'attr'
|
||||
# now holds Code(const) and thus can not be used
|
||||
# for comparism (todo: think about changing this)
|
||||
# for comparison (todo: think about changing this)
|
||||
# pattr = 'code_object @ 0x%x %s->%s' %\
|
||||
# (id(const), const.co_filename, const.co_name)
|
||||
pattr = '<code_object ' + const.co_name + '>'
|
||||
|
Reference in New Issue
Block a user