From: Ned Deily Date: Thu, 6 Feb 2014 00:55:20 +0000 (-0800) Subject: Issue #20374: merge X-Git-Tag: v3.4.0rc1~76^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b104abdc99d79c995edcaf9f8096841cfbcfe6a;p=thirdparty%2FPython%2Fcpython.git Issue #20374: merge --- 4b104abdc99d79c995edcaf9f8096841cfbcfe6a diff --cc Modules/readline.c index 02521aaca4bb,ae3e14365f7c..494bc381dcf7 --- a/Modules/readline.c +++ b/Modules/readline.c @@@ -815,33 -773,26 +815,42 @@@ on_hook(PyObject *func return result; } + static int + #if defined(_RL_FUNCTION_TYPEDEF) on_startup_hook(void) + #else + on_startup_hook() + #endif { - return on_hook(startup_hook); + int r; +#ifdef WITH_THREAD + PyGILState_STATE gilstate = PyGILState_Ensure(); +#endif + r = on_hook(readlinestate_global->startup_hook); +#ifdef WITH_THREAD + PyGILState_Release(gilstate); +#endif + return r; } #ifdef HAVE_RL_PRE_INPUT_HOOK static int + #if defined(_RL_FUNCTION_TYPEDEF) on_pre_input_hook(void) + #else + on_pre_input_hook() + #endif { - return on_hook(pre_input_hook); + int r; +#ifdef WITH_THREAD + PyGILState_STATE gilstate = PyGILState_Ensure(); +#endif + r = on_hook(readlinestate_global->pre_input_hook); +#ifdef WITH_THREAD + PyGILState_Release(gilstate); +#endif + return r; } #endif