summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-30 21:05:00 (GMT)
committerGitHub <noreply@github.com>2017-11-30 21:05:00 (GMT)
commitb4d1e1f7c1af6ae33f0e371576c8bcafedb099db (patch)
tree857873eca2c22a51524b53fb54e30ea9f66f66d7 /Doc/c-api/init.rst
parent986375ebde0dd5ff2b7349e445a06bd28a3a8ee2 (diff)
downloadcpython-b4d1e1f7c1af6ae33f0e371576c8bcafedb099db.zip
cpython-b4d1e1f7c1af6ae33f0e371576c8bcafedb099db.tar.gz
cpython-b4d1e1f7c1af6ae33f0e371576c8bcafedb099db.tar.bz2
bpo-20891: Fix PyGILState_Ensure() (#4650)
When PyGILState_Ensure() is called in a non-Python thread before PyEval_InitThreads(), only call PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. Add an unit test in test_embed.
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r--Doc/c-api/init.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 2f77bb3..a9927ab 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -58,8 +58,9 @@ 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` and
- :c:func:`Py_GetProgramFullPath` and :c:func:`Py_GetPythonHome`.
+ :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
+ :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
+ :c:func:`PyEval_InitThreads`.
.. _global-conf-vars: