]> granicus.if.org Git - python/commitdiff
Closes #15620: check for presence of readline.clear_history(), which is apparently...
authorGeorg Brandl <georg@python.org>
Sat, 11 Aug 2012 08:59:23 +0000 (10:59 +0200)
committerGeorg Brandl <georg@python.org>
Sat, 11 Aug 2012 08:59:23 +0000 (10:59 +0200)
Lib/test/test_readline.py

index 5483dd31b8059bc396da3f08a5cc308df7704106..fe74939026ca7d6d4a0d1489678ab82172ac947c 100644 (file)
@@ -17,7 +17,9 @@ class TestHistoryManipulation (unittest.TestCase):
                      "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")