summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-26 01:31:11 (GMT)
committerGitHub <noreply@github.com>2019-03-26 01:31:11 (GMT)
commit20004959d23d07ac784eef51ecb161012180faa8 (patch)
tree7fcc04b0924c2180d234196d3886e58cb57e2609 /Include/internal
parentf78a5e9ce8f32a195f5f788aade79578437f30a6 (diff)
downloadcpython-20004959d23d07ac784eef51ecb161012180faa8.zip
cpython-20004959d23d07ac784eef51ecb161012180faa8.tar.gz
cpython-20004959d23d07ac784eef51ecb161012180faa8.tar.bz2
bpo-36301: Remove _PyCoreConfig.preconfig (GH-12546)
* Replace _PyCoreConfig.preconfig with 3 new fields in _PyCoreConfig: isolated, use_environment, dev_mode. * Add _PyPreCmdline.dev_mode. * Add _Py_PreInitializeFromPreConfigInPlace().
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_coreconfig.h6
-rw-r--r--Include/internal/pycore_pylifecycle.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/Include/internal/pycore_coreconfig.h b/Include/internal/pycore_coreconfig.h
index 829ff31..d79f590 100644
--- a/Include/internal/pycore_coreconfig.h
+++ b/Include/internal/pycore_coreconfig.h
@@ -16,12 +16,14 @@ typedef struct {
_PyWstrList xoptions; /* "-X value" option */
int use_environment; /* -E option */
int isolated; /* -I option */
+ int dev_mode; /* -X dev and PYTHONDEVMODE */
} _PyPreCmdline;
#define _PyPreCmdline_INIT \
(_PyPreCmdline){ \
.use_environment = -1, \
- .isolated = -1}
+ .isolated = -1, \
+ .dev_mode = -1}
/* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */
PyAPI_FUNC(void) _PyPreCmdline_Clear(_PyPreCmdline *cmdline);
@@ -112,7 +114,7 @@ PyAPI_FUNC(void) _PyCoreConfig_SetGlobalConfig(const _PyCoreConfig *config);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *config);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_ReadFromArgv(_PyCoreConfig *config,
const _PyArgv *args);
-PyAPI_FUNC(_PyInitError) _PyCoreConfig_Write(const _PyCoreConfig *config);
+PyAPI_FUNC(void) _PyCoreConfig_Write(const _PyCoreConfig *config);
/* --- _PyMainInterpreterConfig ----------------------------------- */
diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h
index 9514b1c..3214d6b 100644
--- a/Include/internal/pycore_pylifecycle.h
+++ b/Include/internal/pycore_pylifecycle.h
@@ -77,6 +77,9 @@ extern void _PyGILState_Fini(void);
PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void);
+PyAPI_FUNC(_PyInitError) _Py_PreInitializeInPlace(
+ _PyPreConfig *config);
+
#ifdef __cplusplus
}
#endif