diff options
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 57060d8..f5c4ade 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -1064,8 +1064,9 @@ def main(): for statements, kind in ((exec_tests, "exec"), (single_tests, "single"), (eval_tests, "eval")): print(kind+"_results = [") - for s in statements: - print(repr(to_tuple(compile(s, "?", kind, 0x400)))+",") + for statement in statements: + tree = ast.parse(statement, "?", kind) + print("%r," % (to_tuple(tree),)) print("]") print("main()") raise SystemExit |