mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Closes #15620: check for presence of readline.clear_history(), which is apparently missing on some readline versions, before calling it in the test.
This commit is contained in:
parent
03b4d5072a
commit
22bfa37ed0
1 changed files with 3 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue