summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c5
1 files changed, 5 insertions, 0 deletions
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 @@ Py_CompileStringFlags(const char *str, const char *filename, int start,
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;