# HG changeset patch # User Ned Deily # Date 1285057503 25200 # Branch release27-maint # Node ID 6b181baf5c5697357f7fb2059762787f0b937aa6 # Parent 35d04ababf4775f7238b613c1e7c769c1a621002 Issue 9907: when readline module linked with OS X libedit instead of GNU libreadline, interpreter treated TAB as completions by default rather than just inserting (2.7 patch) diff -r 35d04ababf47 -r 6b181baf5c56 Modules/readline.c --- Modules/readline.c Tue Sep 21 04:10:45 2010 +0200 +++ Modules/readline.c Tue Sep 21 01:25:03 2010 -0700 @@ -865,6 +865,14 @@ Py_FatalError("not enough memory to save locale"); #endif +#ifdef __APPLE__ + /* the libedit readline emulation resets key bindings etc + * when calling rl_initialize. So call it upfront + */ + if (using_libedit_emulation) + rl_initialize(); +#endif /* __APPLE__ */ + using_history(); rl_readline_name = "python"; @@ -896,8 +904,11 @@ * XXX: A bug in the readline-2.2 library causes a memory leak * inside this function. Nothing we can do about it. */ - rl_initialize(); - +#ifdef __APPLE__ + if (!using_libedit_emulation) +#endif /* __APPLE__ */ + rl_initialize(); + RESTORE_LOCALE(saved_locale) }