You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Some small variable-name changes
This commit is contained in:
@@ -2564,7 +2564,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
code,
|
||||
is_lambda=False,
|
||||
noneInNames=False,
|
||||
isTopLevel=False,
|
||||
is_top_level_module=False,
|
||||
):
|
||||
|
||||
# FIXME: DRY with fragments.py
|
||||
@@ -2590,10 +2590,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
except (python_parser.ParserError, AssertionError) as e:
|
||||
raise ParserError(e, tokens, self.p.debug["reduce"])
|
||||
transform_ast = self.treeTransform.transform(ast, code)
|
||||
transform_tree = self.treeTransform.transform(ast, code)
|
||||
self.maybe_show_tree(ast, phase="after")
|
||||
del ast # Save memory
|
||||
return transform_ast
|
||||
return transform_tree
|
||||
|
||||
# The bytecode for the end of the main routine has a
|
||||
# "return None". However you can't issue a "return" statement in
|
||||
@@ -2605,7 +2605,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
# Python 3.4's classes can add a "return None" which is
|
||||
# invalid syntax.
|
||||
if tokens[-2].kind == "LOAD_CONST":
|
||||
if isTopLevel or tokens[-2].pattr is None:
|
||||
if is_top_level_module or tokens[-2].pattr is None:
|
||||
del tokens[-2:]
|
||||
else:
|
||||
tokens.append(Token("RETURN_LAST"))
|
||||
@@ -2630,12 +2630,12 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
checker(ast, False, self.ast_errors)
|
||||
|
||||
self.customize(customize)
|
||||
transform_ast = self.treeTransform.transform(ast, code)
|
||||
transform_tree = self.treeTransform.transform(ast, code)
|
||||
|
||||
self.maybe_show_tree(ast, phase="before")
|
||||
|
||||
del ast # Save memory
|
||||
return transform_ast
|
||||
return transform_tree
|
||||
|
||||
@classmethod
|
||||
def _get_mapping(cls, node):
|
||||
@@ -2684,7 +2684,7 @@ def code_deparse(
|
||||
linestarts=linestarts,
|
||||
)
|
||||
|
||||
isTopLevel = co.co_name == "<module>"
|
||||
is_top_level_module = co.co_name == "<module>"
|
||||
if compile_mode == "eval":
|
||||
deparsed.hide_internal = False
|
||||
deparsed.compile_mode = compile_mode
|
||||
@@ -2693,7 +2693,7 @@ def code_deparse(
|
||||
customize,
|
||||
co,
|
||||
is_lambda=(compile_mode == "lambda"),
|
||||
isTopLevel=isTopLevel,
|
||||
is_top_level_module=is_top_level_module,
|
||||
)
|
||||
|
||||
#### XXX workaround for profiling
|
||||
|
Reference in New Issue
Block a user