[Python-checkins] cpython (3.2): Closes #15620: check for presence of readline.clear_history(), which is

georg.brandl python-checkins at python.org
Sat Aug 11 10:59:32 CEST 2012


http://hg.python.org/cpython/rev/961a15aff2a6
changeset:   78498:961a15aff2a6
branch:      3.2
parent:      78493:45ef9bc8739f
user:        Georg Brandl <georg at python.org>
date:        Sat Aug 11 10:59:23 2012 +0200
summary:
  Closes #15620: check for presence of readline.clear_history(), which is apparently missing on some readline versions, before calling it in the test.

files:
  Lib/test/test_readline.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -17,7 +17,9 @@
                      "The history update test cannot be run because the "
                      "clear_history method is not available.")
     def testHistoryUpdates(self):
-        readline.clear_history()
+        # Some GNU versions of readline do not support clear_history
+        if hasattr('readline', 'clear_history'):
+            readline.clear_history()
 
         readline.add_history("first line")
         readline.add_history("second line")

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list