diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-28 10:16:06 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-28 10:16:06 +0200 |
commit | 105eabe1ff4ef7cd3ffb9d92b999150ff4cb13e1 (patch) | |
tree | f3615d25e45d523ef173686f168b00c9f9674faf /Lib/test/test_curses.py | |
parent | d6a72ded52bf3bf44f4533f927a60206884eb54b (diff) | |
download | cpython-105eabe1ff4ef7cd3ffb9d92b999150ff4cb13e1.tar.gz |
Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox.
Based on patch by Tycho Andersen.
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r-- | Lib/test/test_curses.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 25284ad522..14ba87f8ca 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -27,6 +27,7 @@ requires('curses') curses = import_module('curses') import_module('curses.panel') import_module('curses.ascii') +import_module('curses.textpad') def requires_curses_func(name): return unittest.skipUnless(hasattr(curses, name), @@ -392,6 +393,14 @@ class TestCurses(unittest.TestCase): human_readable_signature = stdscr.addch.__doc__.split("\n")[0] self.assertIn("[y, x,]", human_readable_signature) + def test_issue13051(self): + stdscr = self.stdscr + box = curses.textpad.Textbox(stdscr, insert_mode=True) + lines, cols = stdscr.getmaxyx() + stdscr.resize(lines-2, cols-2) + # this may cause infinite recursion, leading to a RuntimeError + box._insert_printable_char('a') + class MiscTests(unittest.TestCase): |