From: Antoine Pitrou Date: Tue, 4 Nov 2014 13:52:10 +0000 (+0100) Subject: Issue #22773: fix failing test with old readline versions due to issue #19884. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06c14976dc5f40e92423313d5068d6a71f7765cf;p=python Issue #22773: fix failing test with old readline versions due to issue #19884. --- diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py index aabbf54ec0..e009952a03 100644 --- a/Lib/test/test_readline.py +++ b/Lib/test/test_readline.py @@ -43,6 +43,10 @@ class TestHistoryManipulation (unittest.TestCase): 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 --git a/Modules/readline.c b/Modules/readline.c index 20a16c5051..06ae7c654b 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -1184,4 +1184,7 @@ initreadline(void) PyOS_ReadlineFunctionPointer = call_readline; setup_readline(); + + PyModule_AddIntConstant(m, "_READLINE_VERSION", RL_READLINE_VERSION); + PyModule_AddIntConstant(m, "_READLINE_RUNTIME_VERSION", rl_readline_version); }