Skip to content

Commit

Permalink
Tweak when we delete LOAD_CONST RETURN_VALUE
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Nov 28, 2024
1 parent 74b39e2 commit e4e3743
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uncompyle6/semantics/pysource.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ def build_ast(
is_lambda=False,
noneInNames=False,
is_top_level_module=False,
compile_mode="exec",
) -> GenericASTTraversal:
# FIXME: DRY with fragments.py

Expand Down Expand Up @@ -1262,7 +1263,6 @@ def build_ast(
load_const.kind == "LOAD_CONST"
and load_const.linestart is None
and load_const.attr is None
or is_top_level_module
):
# Delete LOAD_CONST (None) RETURN_VALUE
del tokens[-2:]
Expand Down Expand Up @@ -1371,6 +1371,7 @@ def code_deparse(
co,
is_lambda=is_lambda_mode(compile_mode),
is_top_level_module=is_top_level_module,
compile_mode=compile_mode,
)

# XXX workaround for profiling
Expand Down

0 comments on commit e4e3743

Please sign in to comment.