summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 22ee596947..1888335357 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -816,7 +816,12 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename,
if (str == NULL)
goto error;
+ int current_use_peg = PyInterpreterState_Get()->config.use_peg;
+ if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0) {
+ PyInterpreterState_Get()->config.use_peg = 0;
+ }
result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize);
+ PyInterpreterState_Get()->config.use_peg = current_use_peg;
Py_XDECREF(source_copy);
goto finally;