python-013-fix-readline-6.3.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. fix readline extension compilation against readline 6.3
  2. readline 6.3 removed some typedefs that had been deprecated for some time, but
  3. Python 2.7.6 still uses them and therefore fails to build the readline
  4. extension when it is enabled. This issue has been addressed in the Python bug
  5. tracker here: http://bugs.python.org/issue20374. The patch below is based on
  6. the readline_func_cast.patch patch uploaded there. Also see
  7. http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00003.html for more
  8. information.
  9. This patch should be removed with the next Python 2.7 release, which should
  10. include the fix.
  11. Signed-off-by: Ivan Sergeev <vsergeev@kumunetworks.com>
  12. diff -purN python-2.7.6.orig/Modules/readline.c python-2.7.6/Modules/readline.c
  13. --- python-2.7.6.orig/Modules/readline.c 2014-04-16 13:40:17.566874715 -0700
  14. +++ python-2.7.6/Modules/readline.c 2014-04-16 13:37:15.421231983 -0700
  15. @@ -911,12 +911,12 @@ setup_readline(void)
  16. rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
  17. rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
  18. /* Set our hook functions */
  19. - rl_startup_hook = (Function *)on_startup_hook;
  20. + rl_startup_hook = on_startup_hook;
  21. #ifdef HAVE_RL_PRE_INPUT_HOOK
  22. - rl_pre_input_hook = (Function *)on_pre_input_hook;
  23. + rl_pre_input_hook = on_pre_input_hook;
  24. #endif
  25. /* Set our completion function */
  26. - rl_attempted_completion_function = (CPPFunction *)flex_complete;
  27. + rl_attempted_completion_function = flex_complete;
  28. /* Set Python word break characters */
  29. completer_word_break_characters =
  30. rl_completer_word_break_characters =