# HG changeset patch # User Ned Deily # Date 1285056021 25200 # Branch py3k # Node ID 7ca4295187ce51419a580e51509dba376f68db03 # Parent bb825c0316f700ed26b5415b0a0a3bfa87e3e02c 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 diff -r bb825c0316f7 -r 7ca4295187ce Modules/readline.c --- Modules/readline.c Tue Sep 21 03:57:43 2010 +0200 +++ Modules/readline.c Tue Sep 21 01:00:21 2010 -0700 @@ -886,6 +886,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"; @@ -917,8 +925,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) }