Skip to content

Commit e4e3743

Browse files
committed
Tweak when we delete LOAD_CONST RETURN_VALUE
1 parent 74b39e2 commit e4e3743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uncompyle6/semantics/pysource.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ def build_ast(
12121212
is_lambda=False,
12131213
noneInNames=False,
12141214
is_top_level_module=False,
1215+
compile_mode="exec",
12151216
) -> GenericASTTraversal:
12161217
# FIXME: DRY with fragments.py
12171218

@@ -1262,7 +1263,6 @@ def build_ast(
12621263
load_const.kind == "LOAD_CONST"
12631264
and load_const.linestart is None
12641265
and load_const.attr is None
1265-
or is_top_level_module
12661266
):
12671267
# Delete LOAD_CONST (None) RETURN_VALUE
12681268
del tokens[-2:]
@@ -1371,6 +1371,7 @@ def code_deparse(
13711371
co,
13721372
is_lambda=is_lambda_mode(compile_mode),
13731373
is_top_level_module=is_top_level_module,
1374+
compile_mode=compile_mode,
13741375
)
13751376

13761377
# XXX workaround for profiling

0 commit comments

Comments
 (0)