changeset: 93382:eba6e68e818c branch: 2.7 parent: 93379:e54d0b197c82 user: Antoine Pitrou date: Tue Nov 04 14:52:10 2014 +0100 files: Lib/test/test_readline.py Modules/readline.c description: Issue #22773: fix failing test with old readline versions due to issue #19884. diff -r e54d0b197c82 -r eba6e68e818c Lib/test/test_readline.py --- a/Lib/test/test_readline.py Mon Nov 03 21:12:05 2014 -0500 +++ b/Lib/test/test_readline.py Tue Nov 04 14:52:10 2014 +0100 @@ -43,6 +43,10 @@ class TestReadline(unittest.TestCase): + + @unittest.skipIf(readline._READLINE_VERSION < 0x0600 + and "libedit" not in readline.__doc__, + "not supported in this library version") def test_init(self): # Issue #19884: Ensure that the ANSI sequence "\033[1034h" is not # written into stdout when the readline module is imported and stdout diff -r e54d0b197c82 -r eba6e68e818c Modules/readline.c --- a/Modules/readline.c Mon Nov 03 21:12:05 2014 -0500 +++ b/Modules/readline.c Tue Nov 04 14:52:10 2014 +0100 @@ -1184,4 +1184,7 @@ PyOS_ReadlineFunctionPointer = call_readline; setup_readline(); + + PyModule_AddIntConstant(m, "_READLINE_VERSION", RL_READLINE_VERSION); + PyModule_AddIntConstant(m, "_READLINE_RUNTIME_VERSION", rl_readline_version); }