]> granicus.if.org Git - python/commit
bpo-20891: Fix PyGILState_Ensure() (#4650)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 30 Nov 2017 21:05:00 +0000 (22:05 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Nov 2017 21:05:00 +0000 (22:05 +0100)
commitb4d1e1f7c1af6ae33f0e371576c8bcafedb099db
tree857873eca2c22a51524b53fb54e30ea9f66f66d7
parent986375ebde0dd5ff2b7349e445a06bd28a3a8ee2
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.
Doc/c-api/init.rst
Lib/test/test_embed.py
Misc/NEWS.d/next/C API/2017-11-30-18-13-45.bpo-20891.wBnMdF.rst [new file with mode: 0644]
Programs/_testembed.c
Python/pystate.c