You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Attempt to get 3.5 RETURN_END_IF working
This feels hacky and I'm not sure is quite right. Untili we understand better what to do though, we'll go with it.
This commit is contained in:
@@ -710,6 +710,11 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
if self.return_none or node != AST('return_stmt', [AST('ret_expr', [NONE]), Token('RETURN_VALUE')]):
|
||||
self.write(' ')
|
||||
self.preorder(node[0])
|
||||
# 3.5 does jump optimization. The RETURN_END_IF in the return
|
||||
# statement means to dedent. Earlier versions will just have
|
||||
# RETURN_VALUE
|
||||
if self.version >= 3.5 and node[-1] == 'RETURN_END_IF':
|
||||
self.indentLess()
|
||||
self.println()
|
||||
self.prune() # stop recursing
|
||||
|
||||
|
Reference in New Issue
Block a user