diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-27 01:04:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 01:04:16 (GMT) |
commit | 484f20d2ff95cc2e1bea759852da307bc1d1d944 (patch) | |
tree | 2f170dbbabfbff21d45d5c87d9bc0ecd73ba31ad /Include/cpython | |
parent | 8b9dbc017a190d13f717e714630d620adb7c7ac2 (diff) | |
download | cpython-484f20d2ff95cc2e1bea759852da307bc1d1d944.zip cpython-484f20d2ff95cc2e1bea759852da307bc1d1d944.tar.gz cpython-484f20d2ff95cc2e1bea759852da307bc1d1d944.tar.bz2 |
bpo-36444: Add _PyCoreConfig._init_main (GH-12572)
* Add _PyCoreConfig._init_main: if equals to zero,
_Py_InitializeFromConfig() doesn't call
_Py_InitializeMainInterpreter().
* Add interp_p parameter to _Py_InitializeFromConfig().
* pymain_init() now calls _Py_InitializeFromConfig().
* Make _Py_InitializeCore() private.
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/coreconfig.h | 6 | ||||
-rw-r--r-- | Include/cpython/pylifecycle.h | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h index 827a19a..53493ff 100644 --- a/Include/cpython/coreconfig.h +++ b/Include/cpython/coreconfig.h @@ -365,6 +365,9 @@ typedef struct { If set to -1 (default), inherit Py_FrozenFlag value. */ int _frozen; + /* If non-zero, use "main" Python initialization */ + int _init_main; + } _PyCoreConfig; #ifdef MS_WINDOWS @@ -398,7 +401,8 @@ typedef struct { .buffered_stdio = -1, \ ._install_importlib = 1, \ ._check_hash_pycs_mode = "default", \ - ._frozen = -1} + ._frozen = -1, \ + ._init_main = 1} /* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */ diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h index 1db1d21..496dcb2 100644 --- a/Include/cpython/pylifecycle.h +++ b/Include/cpython/pylifecycle.h @@ -20,9 +20,6 @@ PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromPreConfig( PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromConfig( const _PyCoreConfig *coreconfig); -PyAPI_FUNC(_PyInitError) _Py_InitializeCore( - const _PyCoreConfig *config, - PyInterpreterState **interp); PyAPI_FUNC(int) _Py_IsCoreInitialized(void); @@ -32,7 +29,8 @@ PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter( /* Initialization and finalization */ PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig( - const _PyCoreConfig *config); + const _PyCoreConfig *config, + PyInterpreterState **interp_p); PyAPI_FUNC(void) _Py_NO_RETURN _Py_ExitInitError(_PyInitError err); /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level |