diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-27 14:39:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 14:39:22 (GMT) |
commit | 331a6a56e9a9c72f3e4605987fabdaec72677702 (patch) | |
tree | 49d20cedd9df4371f2410b2fb24255535ca02c50 /Include/internal | |
parent | 8cd5165ba05ff57cfdbbc71c393bddad1ce1ab87 (diff) | |
download | cpython-331a6a56e9a9c72f3e4605987fabdaec72677702.zip cpython-331a6a56e9a9c72f3e4605987fabdaec72677702.tar.gz cpython-331a6a56e9a9c72f3e4605987fabdaec72677702.tar.bz2 |
bpo-36763: Implement the PEP 587 (GH-13592)
* Add a whole new documentation page:
"Python Initialization Configuration"
* PyWideStringList_Append() return type is now PyStatus,
instead of int
* PyInterpreterState_New() now calls PyConfig_Clear() if
PyConfig_InitPythonConfig() fails.
* Rename files:
* Python/coreconfig.c => Python/initconfig.c
* Include/cpython/coreconfig.h => Include/cpython/initconfig.h
* Include/internal/: pycore_coreconfig.h => pycore_initconfig.h
* Rename structures
* _PyCoreConfig => PyConfig
* _PyPreConfig => PyPreConfig
* _PyInitError => PyStatus
* _PyWstrList => PyWideStringList
* Rename PyConfig fields:
* use_module_search_paths => module_search_paths_set
* module_search_path_env => pythonpath_env
* Rename PyStatus field: _func => func
* PyInterpreterState: rename core_config field to config
* Rename macros and functions:
* _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv()
* _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv()
* _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString()
* _PyInitError_Failed() => PyStatus_Exception()
* _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx
* _Py_UnixMain() => Py_BytesMain()
* _Py_ExitInitError() => Py_ExitStatusException()
* _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs()
* _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs()
* _Py_PreInitialize() => Py_PreInitialize()
* _Py_RunMain() => Py_RunMain()
* _Py_InitializeFromConfig() => Py_InitializeFromConfig()
* _Py_INIT_XXX() => _PyStatus_XXX()
* _Py_INIT_FAILED() => _PyStatus_EXCEPTION()
* Rename 'err' PyStatus variables to 'status'
* Convert RUN_CODE() macro to config_run_code() static inline function
* Remove functions:
* _Py_InitializeFromArgs()
* _Py_InitializeFromWideArgs()
* _PyInterpreterState_GetCoreConfig()
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_coreconfig.h | 163 | ||||
-rw-r--r-- | Include/internal/pycore_initconfig.h | 168 | ||||
-rw-r--r-- | Include/internal/pycore_pathconfig.h | 20 | ||||
-rw-r--r-- | Include/internal/pycore_pylifecycle.h | 38 | ||||
-rw-r--r-- | Include/internal/pycore_pystate.h | 14 |
5 files changed, 204 insertions, 199 deletions
diff --git a/Include/internal/pycore_coreconfig.h b/Include/internal/pycore_coreconfig.h deleted file mode 100644 index b17737a..0000000 --- a/Include/internal/pycore_coreconfig.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef Py_INTERNAL_CORECONFIG_H -#define Py_INTERNAL_CORECONFIG_H -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef Py_BUILD_CORE -# error "this header requires Py_BUILD_CORE define" -#endif - -#include "pycore_pystate.h" /* _PyRuntimeState */ - -/* --- _PyInitError ----------------------------------------------- */ - -/* Almost all errors causing Python initialization to fail */ -#ifdef _MSC_VER - /* Visual Studio 2015 doesn't implement C99 __func__ in C */ -# define _Py_INIT_GET_FUNC() __FUNCTION__ -#else -# define _Py_INIT_GET_FUNC() __func__ -#endif - -#define _Py_INIT_OK() \ - (_PyInitError){._type = _Py_INIT_ERR_TYPE_OK,} - /* other fields are set to 0 */ -#define _Py_INIT_ERR(ERR_MSG) \ - (_PyInitError){ \ - ._type = _Py_INIT_ERR_TYPE_ERROR, \ - ._func = _Py_INIT_GET_FUNC(), \ - .err_msg = (ERR_MSG)} - /* other fields are set to 0 */ -#define _Py_INIT_NO_MEMORY() _Py_INIT_ERR("memory allocation failed") -#define _Py_INIT_EXIT(EXITCODE) \ - (_PyInitError){ \ - ._type = _Py_INIT_ERR_TYPE_EXIT, \ - .exitcode = (EXITCODE)} -#define _Py_INIT_IS_ERROR(err) \ - (err._type == _Py_INIT_ERR_TYPE_ERROR) -#define _Py_INIT_IS_EXIT(err) \ - (err._type == _Py_INIT_ERR_TYPE_EXIT) -#define _Py_INIT_FAILED(err) \ - (err._type != _Py_INIT_ERR_TYPE_OK) - -/* --- _PyWstrList ------------------------------------------------ */ - -#define _PyWstrList_INIT (_PyWstrList){.length = 0, .items = NULL} - -#ifndef NDEBUG -PyAPI_FUNC(int) _PyWstrList_CheckConsistency(const _PyWstrList *list); -#endif -PyAPI_FUNC(void) _PyWstrList_Clear(_PyWstrList *list); -PyAPI_FUNC(int) _PyWstrList_Copy(_PyWstrList *list, - const _PyWstrList *list2); -PyAPI_FUNC(int) _PyWstrList_Append(_PyWstrList *list, - const wchar_t *item); -PyAPI_FUNC(PyObject*) _PyWstrList_AsList(const _PyWstrList *list); -PyAPI_FUNC(int) _PyWstrList_Extend(_PyWstrList *list, - const _PyWstrList *list2); - - -/* --- _PyArgv ---------------------------------------------------- */ - -typedef struct { - Py_ssize_t argc; - int use_bytes_argv; - char * const *bytes_argv; - wchar_t * const *wchar_argv; -} _PyArgv; - -PyAPI_FUNC(_PyInitError) _PyArgv_AsWstrList(const _PyArgv *args, - _PyWstrList *list); - - -/* --- Helper functions ------------------------------------------- */ - -PyAPI_FUNC(int) _Py_str_to_int( - const char *str, - int *result); -PyAPI_FUNC(const wchar_t*) _Py_get_xoption( - const _PyWstrList *xoptions, - const wchar_t *name); -PyAPI_FUNC(const char*) _Py_GetEnv( - int use_environment, - const char *name); -PyAPI_FUNC(void) _Py_get_env_flag( - int use_environment, - int *flag, - const char *name); - -/* Py_GetArgcArgv() helper */ -PyAPI_FUNC(void) _Py_ClearArgcArgv(void); - - -/* --- _PyPreCmdline ------------------------------------------------- */ - -typedef struct { - _PyWstrList argv; - _PyWstrList xoptions; /* "-X value" option */ - int isolated; /* -I option */ - int use_environment; /* -E option */ - int dev_mode; /* -X dev and PYTHONDEVMODE */ -} _PyPreCmdline; - -#define _PyPreCmdline_INIT \ - (_PyPreCmdline){ \ - .use_environment = -1, \ - .isolated = -1, \ - .dev_mode = -1} -/* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */ - -PyAPI_FUNC(void) _PyPreCmdline_Clear(_PyPreCmdline *cmdline); -PyAPI_FUNC(_PyInitError) _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, - const _PyArgv *args); -PyAPI_FUNC(int) _PyPreCmdline_SetCoreConfig( - const _PyPreCmdline *cmdline, - _PyCoreConfig *config); -PyAPI_FUNC(_PyInitError) _PyPreCmdline_Read(_PyPreCmdline *cmdline, - const _PyPreConfig *preconfig); - - -/* --- _PyPreConfig ----------------------------------------------- */ - -PyAPI_FUNC(void) _PyPreConfig_InitCompatConfig(_PyPreConfig *config); -PyAPI_FUNC(void) _PyPreConfig_InitFromCoreConfig( - _PyPreConfig *config, - const _PyCoreConfig *coreconfig); -PyAPI_FUNC(void) _PyPreConfig_InitFromPreConfig( - _PyPreConfig *config, - const _PyPreConfig *config2); -PyAPI_FUNC(void) _PyPreConfig_Copy(_PyPreConfig *config, - const _PyPreConfig *config2); -PyAPI_FUNC(PyObject*) _PyPreConfig_AsDict(const _PyPreConfig *config); -PyAPI_FUNC(void) _PyPreConfig_GetCoreConfig(_PyPreConfig *config, - const _PyCoreConfig *core_config); -PyAPI_FUNC(_PyInitError) _PyPreConfig_Read(_PyPreConfig *config, - const _PyArgv *args); -PyAPI_FUNC(_PyInitError) _PyPreConfig_Write(const _PyPreConfig *config); - - -/* --- _PyCoreConfig ---------------------------------------------- */ - -PyAPI_FUNC(void) _PyCoreConfig_InitCompatConfig(_PyCoreConfig *config); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_Copy( - _PyCoreConfig *config, - const _PyCoreConfig *config2); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_InitPathConfig(_PyCoreConfig *config); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetPathConfig( - const _PyCoreConfig *config); -PyAPI_FUNC(void) _PyCoreConfig_Write(const _PyCoreConfig *config, - _PyRuntimeState *runtime); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetPyArgv( - _PyCoreConfig *config, - const _PyArgv *args); - - -/* --- Function used for testing ---------------------------------- */ - -PyAPI_FUNC(PyObject*) _Py_GetConfigsAsDict(void); - -#ifdef __cplusplus -} -#endif -#endif /* !Py_INTERNAL_CORECONFIG_H */ diff --git a/Include/internal/pycore_initconfig.h b/Include/internal/pycore_initconfig.h new file mode 100644 index 0000000..c0b3d95 --- /dev/null +++ b/Include/internal/pycore_initconfig.h @@ -0,0 +1,168 @@ +#ifndef Py_INTERNAL_CORECONFIG_H +#define Py_INTERNAL_CORECONFIG_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pystate.h" /* _PyRuntimeState */ + +/* --- PyStatus ----------------------------------------------- */ + +/* Almost all errors causing Python initialization to fail */ +#ifdef _MSC_VER + /* Visual Studio 2015 doesn't implement C99 __func__ in C */ +# define _PyStatus_GET_FUNC() __FUNCTION__ +#else +# define _PyStatus_GET_FUNC() __func__ +#endif + +#define _PyStatus_OK() \ + (PyStatus){._type = _PyStatus_TYPE_OK,} + /* other fields are set to 0 */ +#define _PyStatus_ERR(ERR_MSG) \ + (PyStatus){ \ + ._type = _PyStatus_TYPE_ERROR, \ + .func = _PyStatus_GET_FUNC(), \ + .err_msg = (ERR_MSG)} + /* other fields are set to 0 */ +#define _PyStatus_NO_MEMORY() _PyStatus_ERR("memory allocation failed") +#define _PyStatus_EXIT(EXITCODE) \ + (PyStatus){ \ + ._type = _PyStatus_TYPE_EXIT, \ + .exitcode = (EXITCODE)} +#define _PyStatus_IS_ERROR(err) \ + (err._type == _PyStatus_TYPE_ERROR) +#define _PyStatus_IS_EXIT(err) \ + (err._type == _PyStatus_TYPE_EXIT) +#define _PyStatus_EXCEPTION(err) \ + (err._type != _PyStatus_TYPE_OK) + +/* --- PyWideStringList ------------------------------------------------ */ + +#define PyWideStringList_INIT (PyWideStringList){.length = 0, .items = NULL} + +#ifndef NDEBUG +PyAPI_FUNC(int) _PyWideStringList_CheckConsistency(const PyWideStringList *list); +#endif +PyAPI_FUNC(void) _PyWideStringList_Clear(PyWideStringList *list); +PyAPI_FUNC(int) _PyWideStringList_Copy(PyWideStringList *list, + const PyWideStringList *list2); +PyAPI_FUNC(PyStatus) _PyWideStringList_Extend(PyWideStringList *list, + const PyWideStringList *list2); +PyAPI_FUNC(PyObject*) _PyWideStringList_AsList(const PyWideStringList *list); + + +/* --- _PyArgv ---------------------------------------------------- */ + +typedef struct { + Py_ssize_t argc; + int use_bytes_argv; + char * const *bytes_argv; + wchar_t * const *wchar_argv; +} _PyArgv; + +PyAPI_FUNC(PyStatus) _PyArgv_AsWstrList(const _PyArgv *args, + PyWideStringList *list); + + +/* --- Helper functions ------------------------------------------- */ + +PyAPI_FUNC(int) _Py_str_to_int( + const char *str, + int *result); +PyAPI_FUNC(const wchar_t*) _Py_get_xoption( + const PyWideStringList *xoptions, + const wchar_t *name); +PyAPI_FUNC(const char*) _Py_GetEnv( + int use_environment, + const char *name); +PyAPI_FUNC(void) _Py_get_env_flag( + int use_environment, + int *flag, + const char *name); + +/* Py_GetArgcArgv() helper */ +PyAPI_FUNC(void) _Py_ClearArgcArgv(void); + + +/* --- _PyPreCmdline ------------------------------------------------- */ + +typedef struct { + PyWideStringList argv; + PyWideStringList xoptions; /* "-X value" option */ + int isolated; /* -I option */ + int use_environment; /* -E option */ + int dev_mode; /* -X dev and PYTHONDEVMODE */ +} _PyPreCmdline; + +#define _PyPreCmdline_INIT \ + (_PyPreCmdline){ \ + .use_environment = -1, \ + .isolated = -1, \ + .dev_mode = -1} +/* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */ + +extern void _PyPreCmdline_Clear(_PyPreCmdline *cmdline); +extern PyStatus _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, + const _PyArgv *args); +extern PyStatus _PyPreCmdline_SetConfig( + const _PyPreCmdline *cmdline, + PyConfig *config); +extern PyStatus _PyPreCmdline_Read(_PyPreCmdline *cmdline, + const PyPreConfig *preconfig); + + +/* --- PyPreConfig ----------------------------------------------- */ + +PyAPI_FUNC(void) _PyPreConfig_InitCompatConfig(PyPreConfig *preconfig); +extern void _PyPreConfig_InitFromConfig( + PyPreConfig *preconfig, + const PyConfig *config); +extern void _PyPreConfig_InitFromPreConfig( + PyPreConfig *preconfig, + const PyPreConfig *config2); +extern PyObject* _PyPreConfig_AsDict(const PyPreConfig *preconfig); +extern void _PyPreConfig_GetConfig(PyPreConfig *preconfig, + const PyConfig *config); +extern PyStatus _PyPreConfig_Read(PyPreConfig *preconfig, + const _PyArgv *args); +extern PyStatus _PyPreConfig_Write(const PyPreConfig *preconfig); + + +/* --- PyConfig ---------------------------------------------- */ + +#define _Py_CONFIG_VERSION 1 + +typedef enum { + /* Py_Initialize() API: backward compatibility with Python 3.6 and 3.7 */ + _PyConfig_INIT_COMPAT = 1, + _PyConfig_INIT_PYTHON = 2, + _PyConfig_INIT_ISOLATED = 3 +} _PyConfigInitEnum; + +PyAPI_FUNC(void) _PyConfig_InitCompatConfig(PyConfig *config); +extern PyStatus _PyConfig_Copy( + PyConfig *config, + const PyConfig *config2); +extern PyStatus _PyConfig_InitPathConfig(PyConfig *config); +extern PyStatus _PyConfig_SetPathConfig( + const PyConfig *config); +extern void _PyConfig_Write(const PyConfig *config, + _PyRuntimeState *runtime); +extern PyStatus _PyConfig_SetPyArgv( + PyConfig *config, + const _PyArgv *args); + + +/* --- Function used for testing ---------------------------------- */ + +PyAPI_FUNC(PyObject*) _Py_GetConfigsAsDict(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CORECONFIG_H */ diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index bee3911..be12c6f 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -37,17 +37,17 @@ typedef struct _PyPathConfig { PyAPI_DATA(_PyPathConfig) _Py_path_config; -PyAPI_FUNC(void) _PyPathConfig_ClearGlobal(void); -PyAPI_FUNC(_PyInitError) _PyPathConfig_SetGlobal( - const struct _PyPathConfig *config); - -PyAPI_FUNC(_PyInitError) _PyPathConfig_Calculate_impl( - _PyPathConfig *config, - const _PyCoreConfig *core_config); -PyAPI_FUNC(int) _PyPathConfig_ComputeSysPath0( - const _PyWstrList *argv, +extern void _PyPathConfig_ClearGlobal(void); +extern PyStatus _PyPathConfig_SetGlobal( + const struct _PyPathConfig *pathconfig); + +extern PyStatus _PyPathConfig_Calculate( + _PyPathConfig *pathconfig, + const PyConfig *config); +extern int _PyPathConfig_ComputeSysPath0( + const PyWideStringList *argv, PyObject **path0); -PyAPI_FUNC(int) _Py_FindEnvConfigValue( +extern int _Py_FindEnvConfigValue( FILE *env_file, const wchar_t *key, wchar_t *value, diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h index 13a31c2..69761ce 100644 --- a/Include/internal/pycore_pylifecycle.h +++ b/Include/internal/pycore_pylifecycle.h @@ -8,20 +8,20 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_coreconfig.h" /* _PyArgv */ +#include "pycore_initconfig.h" /* _PyArgv */ #include "pycore_pystate.h" /* _PyRuntimeState */ /* True if the main interpreter thread exited due to an unhandled * KeyboardInterrupt exception, suggesting the user pressed ^C. */ PyAPI_DATA(int) _Py_UnhandledKeyboardInterrupt; -PyAPI_FUNC(int) _Py_UnixMain(int argc, char **argv); +PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv); extern int _Py_SetFileSystemEncoding( const char *encoding, const char *errors); extern void _Py_ClearFileSystemEncoding(void); -extern _PyInitError _PyUnicode_InitEncodings(PyInterpreterState *interp); +extern PyStatus _PyUnicode_InitEncodings(PyInterpreterState *interp); #ifdef MS_WINDOWS extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void); #endif @@ -32,30 +32,30 @@ PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc); /* Various one-time initializers */ -extern _PyInitError _PyUnicode_Init(void); +extern PyStatus _PyUnicode_Init(void); extern int _PyStructSequence_Init(void); extern int _PyLong_Init(void); -extern _PyInitError _PyFaulthandler_Init(int enable); +extern PyStatus _PyFaulthandler_Init(int enable); extern int _PyTraceMalloc_Init(int enable); extern PyObject * _PyBuiltin_Init(void); -extern _PyInitError _PySys_Create( +extern PyStatus _PySys_Create( _PyRuntimeState *runtime, PyInterpreterState *interp, PyObject **sysmod_p); -extern _PyInitError _PySys_SetPreliminaryStderr(PyObject *sysdict); +extern PyStatus _PySys_SetPreliminaryStderr(PyObject *sysdict); extern int _PySys_InitMain( _PyRuntimeState *runtime, PyInterpreterState *interp); -extern _PyInitError _PyImport_Init(PyInterpreterState *interp); -extern _PyInitError _PyExc_Init(void); -extern _PyInitError _PyErr_Init(void); -extern _PyInitError _PyBuiltins_AddExceptions(PyObject * bltinmod); -extern _PyInitError _PyImportHooks_Init(void); +extern PyStatus _PyImport_Init(PyInterpreterState *interp); +extern PyStatus _PyExc_Init(void); +extern PyStatus _PyErr_Init(void); +extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod); +extern PyStatus _PyImportHooks_Init(void); extern int _PyFloat_Init(void); -extern _PyInitError _Py_HashRandomization_Init(const _PyCoreConfig *); +extern PyStatus _Py_HashRandomization_Init(const PyConfig *); -extern _PyInitError _PyTypes_Init(void); -extern _PyInitError _PyImportZip_Init(PyInterpreterState *interp); +extern PyStatus _PyTypes_Init(void); +extern PyStatus _PyImportZip_Init(PyInterpreterState *interp); /* Various internal finalizers */ @@ -94,11 +94,11 @@ extern void _PyGILState_Fini(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyGC_DumpShutdownStats(_PyRuntimeState *runtime); -PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromPyArgv( - const _PyPreConfig *src_config, +PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv( + const PyPreConfig *src_config, const _PyArgv *args); -PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromCoreConfig( - const _PyCoreConfig *coreconfig, +PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig( + const PyConfig *config, const _PyArgv *args); diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index ef1d8a0..3ab4009 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -8,7 +8,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "cpython/coreconfig.h" +#include "cpython/initconfig.h" #include "fileobject.h" #include "pystate.h" #include "pythread.h" @@ -106,7 +106,7 @@ struct _is { _Py_error_handler error_handler; } fs_codec; - _PyCoreConfig core_config; + PyConfig config; #ifdef HAVE_DLOPEN int dlopenflags; #endif @@ -193,7 +193,7 @@ struct _gilstate_runtime_state { /* Full Python runtime state */ typedef struct pyruntimestate { - /* Is Python pre-initialized? Set to 1 by _Py_PreInitialize() */ + /* Is Python pre-initialized? Set to 1 by Py_PreInitialize() */ int pre_initialized; /* Is Python core initialized? Set to 1 by _Py_InitializeCore() */ @@ -234,7 +234,7 @@ typedef struct pyruntimestate { struct _ceval_runtime_state ceval; struct _gilstate_runtime_state gilstate; - _PyPreConfig preconfig; + PyPreConfig preconfig; Py_OpenCodeHookFunction open_code_hook; void *open_code_userdata; @@ -248,13 +248,13 @@ typedef struct pyruntimestate { /* Note: _PyRuntimeState_INIT sets other fields to 0/NULL */ PyAPI_DATA(_PyRuntimeState) _PyRuntime; -PyAPI_FUNC(_PyInitError) _PyRuntimeState_Init(_PyRuntimeState *runtime); +PyAPI_FUNC(PyStatus) _PyRuntimeState_Init(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyRuntimeState_Fini(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime); /* Initialize _PyRuntimeState. Return NULL on success, or return an error message on failure. */ -PyAPI_FUNC(_PyInitError) _PyRuntime_Initialize(void); +PyAPI_FUNC(PyStatus) _PyRuntime_Initialize(void); PyAPI_FUNC(void) _PyRuntime_Finalize(void); @@ -307,7 +307,7 @@ PyAPI_FUNC(PyThreadState *) _PyThreadState_Swap( struct _gilstate_runtime_state *gilstate, PyThreadState *newts); -PyAPI_FUNC(_PyInitError) _PyInterpreterState_Enable(_PyRuntimeState *runtime); +PyAPI_FUNC(PyStatus) _PyInterpreterState_Enable(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyGILState_Reinit(_PyRuntimeState *runtime); |