You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
"return None" -> "pass"
Python 3.4 classes have what looks like a return None, but this is invalid syntax. So for now we'll remove all "return None"s. There may be a "pass" in there instead.
This commit is contained in:
Binary file not shown.
@@ -2068,9 +2068,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
if self.hide_internal:
|
||||
if len(tokens) >= 2 and not noneInNames:
|
||||
if tokens[-1].type == 'RETURN_VALUE':
|
||||
# Should we also check for returning None?
|
||||
# Python 3.4's classes can add a "return None" which is
|
||||
# invalid syntax.
|
||||
if tokens[-2].type == 'LOAD_CONST':
|
||||
if isTopLevel:
|
||||
if isTopLevel or tokens[-2].pattr is None:
|
||||
del tokens[-2:]
|
||||
else:
|
||||
tokens.append(Token('RETURN_LAST'))
|
||||
|
Reference in New Issue
Block a user