]> granicus.if.org Git - python/commitdiff
Issue #20374: merge
authorNed Deily <nad@acm.org>
Thu, 6 Feb 2014 00:55:20 +0000 (16:55 -0800)
committerNed Deily <nad@acm.org>
Thu, 6 Feb 2014 00:55:20 +0000 (16:55 -0800)
1  2 
Modules/readline.c

index 02521aaca4bb4e9166c4b92c1a4e850a635f2a9f,ae3e14365f7c1b2256b0f07d7bbe9ea5788f99c6..494bc381dcf75a24f6dd2df6c7c8fc50d5954c5d
@@@ -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