]> granicus.if.org Git - python/commit
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 30 Nov 2017 22:36:49 +0000 (23:36 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Nov 2017 22:36:49 +0000 (23:36 +0100)
commite10c9de9d74fd4c26b32e6719d96f04a5be6987d
treed52af6d26b53ff529cfab22ea50bb6b5faea7a03
parent29cb50ba347d9dc18e0720bef8e9caedd012a3cd
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655)

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.

Enhance also embedded tests, backport from master:

* Add test_pre_initialization_api()
* Set PYTHONIOENCODING environment variable in
  test_forced_io_encoding()

(cherry picked from commit b4d1e1f7c1af6ae33f0e371576c8bcafedb099db)
Lib/test/test_capi.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