diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-13 01:04:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 01:04:28 (GMT) |
commit | da7933ecc30e37b119756cb02b89a6ad99db22e0 (patch) | |
tree | e6c7227f2ded7b7354fb027342fa977f70808d10 /Python/compile.c | |
parent | 14d5331eb5e6c38be12bad421bd59ad0fac9e448 (diff) | |
download | cpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.zip cpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.tar.gz cpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.tar.bz2 |
bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)
Don't access PyInterpreterState.config member directly anymore, but
use new functions:
* _PyInterpreterState_GetConfig()
* _PyInterpreterState_SetConfig()
* _Py_GetConfig()
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c index 329add9..54e6516 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -23,7 +23,6 @@ #include "Python.h" -#include "pycore_pystate.h" /* _PyInterpreterState_GET_UNSAFE() */ #include "Python-ast.h" #include "ast.h" #include "code.h" @@ -323,7 +322,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, PyCodeObject *co = NULL; PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int merged; - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; if (!__doc__) { __doc__ = PyUnicode_InternFromString("__doc__"); @@ -350,7 +348,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, c.c_future->ff_features = merged; flags->cf_flags = merged; c.c_flags = flags; - c.c_optimize = (optimize == -1) ? config->optimization_level : optimize; + c.c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize; c.c_nestlevel = 0; c.c_do_not_emit_bytecode = 0; |