We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74b39e2 commit e4e3743Copy full SHA for e4e3743
uncompyle6/semantics/pysource.py
@@ -1212,6 +1212,7 @@ def build_ast(
1212
is_lambda=False,
1213
noneInNames=False,
1214
is_top_level_module=False,
1215
+ compile_mode="exec",
1216
) -> GenericASTTraversal:
1217
# FIXME: DRY with fragments.py
1218
@@ -1262,7 +1263,6 @@ def build_ast(
1262
1263
load_const.kind == "LOAD_CONST"
1264
and load_const.linestart is None
1265
and load_const.attr is None
- or is_top_level_module
1266
):
1267
# Delete LOAD_CONST (None) RETURN_VALUE
1268
del tokens[-2:]
@@ -1371,6 +1371,7 @@ def code_deparse(
1371
co,
1372
is_lambda=is_lambda_mode(compile_mode),
1373
is_top_level_module=is_top_level_module,
1374
+ compile_mode=compile_mode,
1375
)
1376
1377
# XXX workaround for profiling
0 commit comments