From: Georg Brandl Date: Sat, 11 Aug 2012 08:59:23 +0000 (+0200) Subject: Closes #15620: check for presence of readline.clear_history(), which is apparently... X-Git-Tag: v3.3.0rc1~150^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=22bfa37ed06e829bbc2e6a247648693983e2be57;p=thirdparty%2FPython%2Fcpython.git Closes #15620: check for presence of readline.clear_history(), which is apparently missing on some readline versions, before calling it in the test. --- diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py index 5483dd31b805..fe74939026ca 100644 --- a/Lib/test/test_readline.py +++ b/Lib/test/test_readline.py @@ -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")