Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated for version 7.3.698

Problem:    Python 3 does not preserve state beween commands.
Solution:   Preserve the state. (Paul Ollis)
  • Loading branch information...
commit 9cb2e95126e9e83b9aa3812cde73cb8f7cdd9871 1 parent 1050735
Bram Moolenaar authored
Showing with 11 additions and 4 deletions.
  1. +4 −3 src/if_python.c
  2. +5 −1 src/if_python3.c
  3. +2 −0  src/version.c
View
7 src/if_python.c
@@ -740,9 +740,10 @@ Python_Init(void)
#else
PyMac_Initialize();
#endif
- /* Initialise threads and save the state using PyGILState_Ensure.
- * Without this call, thread-specific state (such as the system trace
- * hook), will be lost between invocations of Python code. */
+ /* Initialise threads, and save the state using PyGILState_Ensure.
+ * Without the call to PyGILState_Ensure, thread specific state (such
+ * as the system trace hook), will be lost between invocations of
+ * Python code. */
PyEval_InitThreads();
pygilstate = PyGILState_Ensure();
#ifdef DYNAMIC_PYTHON
View
6 src/if_python3.c
@@ -731,8 +731,12 @@ Python3_Init(void)
#else
PyMac_Initialize();
#endif
- /* initialise threads, must be after Py_Initialize() */
+ /* Initialise threads, and save the state using PyGILState_Ensure.
+ * Without the call to PyGILState_Ensure, thread specific state (such
+ * as the system trace hook), will be lost between invocations of
+ * Python code. */
PyEval_InitThreads();
+ pygilstate = PyGILState_Ensure();
#ifdef DYNAMIC_PYTHON3
get_py3_exceptions();
View
2  src/version.c
@@ -720,6 +720,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 698,
+/**/
697,
/**/
696,
Please sign in to comment.
Something went wrong with that request. Please try again.