summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-02 09:11:32 (GMT)
committerGitHub <noreply@github.com>2017-12-02 09:11:32 (GMT)
commitaf5a895073c24637c094772b27526b94a12ec897 (patch)
tree2960347bdeb6d0ba50746d5d36630d13630f1bb9 /Doc/c-api/init.rst
parente23c06e2b03452c9aaf0dae52296c85e572f9bcd (diff)
downloadcpython-af5a895073c24637c094772b27526b94a12ec897.zip
cpython-af5a895073c24637c094772b27526b94a12ec897.tar.gz
cpython-af5a895073c24637c094772b27526b94a12ec897.tar.bz2
bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)
_PyPathConfig_Init() now also initialize home and program_name: * Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate(). Add a new _PyPathConfig_Init() function in pathconfig.c which handles the _Py_path_config variable and call _PyPathConfig_Calculate(). * Add home and program_name fields to _PyPathConfig.home * _PyPathConfig_Init() now initialize home and program_name from main_config * Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now calls Py_FatalError() on failure, instead of silently ignoring failures. * config_init_home() now gets directly _Py_path_config.home to only get the value set by Py_SetPythonHome(), or NULL if Py_SetPythonHome() was not called. * config_get_program_name() now gets directly _Py_path_config.program_name to only get the value set by Py_SetProgramName(), or NULL if Py_SetProgramName() was not called. * pymain_init_python() doesn't call Py_SetProgramName() anymore, _PyPathConfig_Init() now always sets the program name * Call _PyMainInterpreterConfig_Read() in pymain_parse_cmdline_envvars_impl() to control the memory allocator * C API documentation: it's no more safe to call Py_GetProgramName() before Py_Initialize().
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r--Doc/c-api/init.rst5
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index a9927ab..a3113a3 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -40,7 +40,6 @@ The following functions can be safely called before Python is initialized:
* :c:func:`Py_GetCompiler`
* :c:func:`Py_GetCopyright`
* :c:func:`Py_GetPlatform`
- * :c:func:`Py_GetProgramName`
* :c:func:`Py_GetVersion`
* Utilities:
@@ -59,8 +58,8 @@ The following functions can be safely called before Python is initialized:
The following functions **should not be called** before
:c:func:`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
- :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
- :c:func:`PyEval_InitThreads`.
+ :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
+ :c:func:`Py_GetProgramName` and :c:func:`PyEval_InitThreads`.
.. _global-conf-vars: