diff options
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 41f2174..6e24131 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1495,11 +1495,10 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, return NULL; } if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { - if ((flags->cf_flags & PyCF_OPTIMIZED_AST) == PyCF_OPTIMIZED_AST) { - if (_PyCompile_AstOptimize(mod, filename, flags, optimize, arena) < 0) { - _PyArena_Free(arena); - return NULL; - } + int syntax_check_only = ((flags->cf_flags & PyCF_OPTIMIZED_AST) == PyCF_ONLY_AST); /* unoptiomized AST */ + if (_PyCompile_AstOptimize(mod, filename, flags, optimize, arena, syntax_check_only) < 0) { + _PyArena_Free(arena); + return NULL; } PyObject *result = PyAST_mod2obj(mod); _PyArena_Free(arena); |