summaryrefslogtreecommitdiffstats
path: root/Include/pylifecycle.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-07-25 00:49:17 (GMT)
committerGitHub <noreply@github.com>2018-07-25 00:49:17 (GMT)
commit1dc6e3906acb81163725e98378bf4d1bd1ce771a (patch)
tree8aa562d0a219b6880ed4757ac6ae2367024b3b76 /Include/pylifecycle.h
parent6cf8255912c36fec6f87f62513034d0818f61390 (diff)
downloadcpython-1dc6e3906acb81163725e98378bf4d1bd1ce771a.zip
cpython-1dc6e3906acb81163725e98378bf4d1bd1ce771a.tar.gz
cpython-1dc6e3906acb81163725e98378bf4d1bd1ce771a.tar.bz2
bpo-34170: Add _Py_InitializeFromConfig() (GH-8454)
* If _Py_InitializeCore() is called twice, the second call now copies and apply (partially) the new configuration. * Rename _Py_CommandLineDetails to _PyCmdline * Move more code into pymain_init(). The core configuration created by Py_Main() is new destroyed before running Python to reduce the memory footprint. * _Py_InitializeCore() now returns the created interpreter. _Py_InitializeMainInterpreter() now expects an interpreter. * Remove _Py_InitializeEx_Private(): _freeze_importlib now uses _Py_InitializeFromConfig() * _PyCoreConfig_InitPathConfig() now only computes the path configuration if needed.
Diffstat (limited to 'Include/pylifecycle.h')
-rw-r--r--Include/pylifecycle.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h
index 3e43a98..6e5d796 100644
--- a/Include/pylifecycle.h
+++ b/Include/pylifecycle.h
@@ -51,7 +51,9 @@ PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
const char *errors);
/* PEP 432 Multi-phase initialization API (Private while provisional!) */
-PyAPI_FUNC(_PyInitError) _Py_InitializeCore(const _PyCoreConfig *);
+PyAPI_FUNC(_PyInitError) _Py_InitializeCore(
+ PyInterpreterState **interp,
+ const _PyCoreConfig *);
PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *config);
@@ -73,14 +75,17 @@ PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy(
_PyMainInterpreterConfig *config,
const _PyMainInterpreterConfig *config2);
-PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter(const _PyMainInterpreterConfig *);
+PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter(
+ PyInterpreterState *interp,
+ const _PyMainInterpreterConfig *);
#endif
/* Initialization and finalization */
PyAPI_FUNC(void) Py_Initialize(void);
PyAPI_FUNC(void) Py_InitializeEx(int);
#ifndef Py_LIMITED_API
-PyAPI_FUNC(_PyInitError) _Py_InitializeEx_Private(int, int);
+PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig(
+ const _PyCoreConfig *config);
PyAPI_FUNC(void) _Py_FatalInitError(_PyInitError err) _Py_NO_RETURN;
#endif
PyAPI_FUNC(void) Py_Finalize(void);