You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Tweak when we delete LOAD_CONST RETURN_VALUE
This commit is contained in:
@@ -1212,6 +1212,7 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
|||||||
is_lambda=False,
|
is_lambda=False,
|
||||||
noneInNames=False,
|
noneInNames=False,
|
||||||
is_top_level_module=False,
|
is_top_level_module=False,
|
||||||
|
compile_mode="exec",
|
||||||
) -> GenericASTTraversal:
|
) -> GenericASTTraversal:
|
||||||
# FIXME: DRY with fragments.py
|
# FIXME: DRY with fragments.py
|
||||||
|
|
||||||
@@ -1262,7 +1263,6 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
|||||||
load_const.kind == "LOAD_CONST"
|
load_const.kind == "LOAD_CONST"
|
||||||
and load_const.linestart is None
|
and load_const.linestart is None
|
||||||
and load_const.attr is None
|
and load_const.attr is None
|
||||||
or is_top_level_module
|
|
||||||
):
|
):
|
||||||
# Delete LOAD_CONST (None) RETURN_VALUE
|
# Delete LOAD_CONST (None) RETURN_VALUE
|
||||||
del tokens[-2:]
|
del tokens[-2:]
|
||||||
@@ -1371,6 +1371,7 @@ def code_deparse(
|
|||||||
co,
|
co,
|
||||||
is_lambda=is_lambda_mode(compile_mode),
|
is_lambda=is_lambda_mode(compile_mode),
|
||||||
is_top_level_module=is_top_level_module,
|
is_top_level_module=is_top_level_module,
|
||||||
|
compile_mode=compile_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
# XXX workaround for profiling
|
# XXX workaround for profiling
|
||||||
|
Reference in New Issue
Block a user