Skip to content

Commit 800e8a7

Browse files
committed
updated for version 7.3.691
Problem: State specific to the Python thread is discarded. Solution: Keep state between threads. (Paul)
1 parent 8626f53 commit 800e8a7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/if_python.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,11 @@ Python_Init(void)
740740
#else
741741
PyMac_Initialize();
742742
#endif
743-
/* initialise threads */
743+
/* Initialise threads and save the state using PyGILState_Ensure.
744+
* Without this call, thread-specific state (such as the system trace
745+
* hook), will be lost between invocations of Python code. */
744746
PyEval_InitThreads();
745-
747+
pygilstate = PyGILState_Ensure();
746748
#ifdef DYNAMIC_PYTHON
747749
get_exceptions();
748750
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
691,
722724
/**/
723725
690,
724726
/**/

0 commit comments

Comments
 (0)