Generate code to recursively copy an AST into
a tree of Python objects. Expose this through compile().
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 0b7de42..3cb03dc 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1254,6 +1254,11 @@
PyArena_Free(arena);
return NULL;
}
+ if (flags->cf_flags & PyCF_ONLY_AST) {
+ PyObject *result = PyAST_mod2obj(mod);
+ PyArena_Free(arena);
+ return result;
+ }
co = PyAST_Compile(mod, filename, flags, arena);
PyArena_Free(arena);
return (PyObject *)co;