diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-04-22 23:29:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 23:29:27 +0100 |
commit | c5fc15685202cda73f7c3f5c6f299b0945f58508 (patch) | |
tree | 7624ae45b95f2812e801c5879bdbdcb796f570a6 /Python/bltinmodule.c | |
parent | a81849b0315277bb3937271174aaaa5059c0b445 (diff) | |
download | cpython-git-c5fc15685202cda73f7c3f5c6f299b0945f58508.tar.gz |
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 5 |
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; |