You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Need parens in unpack in 2.4ish
This commit is contained in:
@@ -88,7 +88,7 @@ def main_bin():
|
||||
'fragments verify verify-run version '
|
||||
'syntax-verify '
|
||||
'showgrammar encoding='.split(' '))
|
||||
except getopt.GetoptError(e):
|
||||
except getopt.GetoptError, e:
|
||||
sys.stderr.write('%s: %s\n' %
|
||||
(os.path.basename(sys.argv[0]), e))
|
||||
sys.exit(-1)
|
||||
|
@@ -1827,9 +1827,15 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
self.write(', ')
|
||||
self.prune()
|
||||
return
|
||||
|
||||
for n in node[1:]:
|
||||
if n[0].kind == 'unpack':
|
||||
n[0].kind = 'unpack_w_parens'
|
||||
|
||||
# In Python 2.4, unpack is used in (a, b, c) of:
|
||||
# except RuntimeError, (a, b, c):
|
||||
if self.version < 2.7:
|
||||
node.kind = 'unpack_w_parens'
|
||||
self.default(node)
|
||||
|
||||
n_unpack_w_parens = n_unpack
|
||||
|
Reference in New Issue
Block a user