Mercurial > vim
changeset 3869:7f10daa706bb v7.3.691
updated for version 7.3.691
Problem: State specific to the Python thread is discarded.
Solution: Keep state between threads. (Paul)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 14 Oct 2012 05:20:12 +0200 |
parents | 9f622266fbf4 |
children | 3346d9015468 |
files | src/if_python.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_python.c +++ b/src/if_python.c @@ -740,9 +740,11 @@ Python_Init(void) #else PyMac_Initialize(); #endif - /* initialise threads */ + /* 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. */ PyEval_InitThreads(); - + pygilstate = PyGILState_Ensure(); #ifdef DYNAMIC_PYTHON get_exceptions(); #endif