summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2020-06-28 00:34:30 (GMT)
committerGitHub <noreply@github.com>2020-06-28 00:34:30 (GMT)
commit2a1ee1d970460047bd88da9638f8c1789431d9ab (patch)
treef9d788be367da763dc8d712b78aa5005c3d0dd35 /Modules
parentdab533d0ee067159812d4ea51f6fbbb1bd37d8b7 (diff)
downloadcpython-2a1ee1d970460047bd88da9638f8c1789431d9ab.zip
cpython-2a1ee1d970460047bd88da9638f8c1789431d9ab.tar.gz
cpython-2a1ee1d970460047bd88da9638f8c1789431d9ab.tar.bz2
[3.9] bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags (#21022)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testcapimodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 8e1ee85..de14408 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3468,6 +3468,8 @@ run_in_subinterp(PyObject *self, PyObject *args)
const char *code;
int r;
PyThreadState *substate, *mainstate;
+ /* only initialise 'cflags.cf_flags' to test backwards compatibility */
+ PyCompilerFlags cflags = {0};
if (!PyArg_ParseTuple(args, "s:run_in_subinterp",
&code))
@@ -3486,7 +3488,7 @@ run_in_subinterp(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_RuntimeError, "sub-interpreter creation failed");
return NULL;
}
- r = PyRun_SimpleString(code);
+ r = PyRun_SimpleStringFlags(code, &cflags);
Py_EndInterpreter(substate);
PyThreadState_Swap(mainstate);