mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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()
This commit is contained in:
parent
14d5331eb5
commit
da7933ecc3
19 changed files with 90 additions and 64 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue