summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_readline.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-08-11 08:59:23 (GMT)
committerGeorg Brandl <georg@python.org>2012-08-11 08:59:23 (GMT)
commit22bfa37ed06e829bbc2e6a247648693983e2be57 (patch)
treec2f9e1bb1bce9c76ad121926b28e36894beb4b58 /Lib/test/test_readline.py
parent03b4d5072aa044d8c6827e387b647dcc6c9d0ff6 (diff)
downloadcpython-22bfa37ed06e829bbc2e6a247648693983e2be57.zip
cpython-22bfa37ed06e829bbc2e6a247648693983e2be57.tar.gz
cpython-22bfa37ed06e829bbc2e6a247648693983e2be57.tar.bz2
Closes #15620: check for presence of readline.clear_history(), which is apparently missing on some readline versions, before calling it in the test.
Diffstat (limited to 'Lib/test/test_readline.py')
-rw-r--r--Lib/test/test_readline.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index 5483dd3..fe74939 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")