mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Patch for bug #1633621: if curses.resizeterm() or
curses.resize_term() is called, update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
This commit is contained in:
parent
40c626159d
commit
d391f0855c
2 changed files with 71 additions and 2 deletions
|
@ -241,12 +241,21 @@ def test_userptr_without_set(stdscr):
|
|||
except curses.panel.error:
|
||||
pass
|
||||
|
||||
def test_resize_term(stdscr):
|
||||
if hasattr(curses, 'resizeterm'):
|
||||
lines, cols = curses.LINES, curses.COLS
|
||||
curses.resizeterm(lines - 1, cols + 1)
|
||||
|
||||
if curses.LINES != lines - 1 or curses.COLS != cols + 1:
|
||||
raise RuntimeError, "Expected resizeterm to update LINES and COLS"
|
||||
|
||||
def main(stdscr):
|
||||
curses.savetty()
|
||||
try:
|
||||
module_funcs(stdscr)
|
||||
window_funcs(stdscr)
|
||||
test_userptr_without_set(stdscr)
|
||||
test_resize_term(stdscr)
|
||||
finally:
|
||||
curses.resetty()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue