mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags (#21021)
This commit is contained in:
parent
1f0f4abb11
commit
9d197c7d48
4 changed files with 30 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue