summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 387a185..fcf9618 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -262,6 +262,14 @@ def test_userptr_memory_leak(stdscr):
if sys.getrefcount(obj) != nrefs:
raise RuntimeError, "set_userptr leaked references"
+def test_userptr_segfault(stdscr):
+ panel = curses.panel.new_panel(stdscr)
+ class A:
+ def __del__(self):
+ panel.set_userptr(None)
+ panel.set_userptr(A())
+ panel.set_userptr(None)
+
def test_resize_term(stdscr):
if hasattr(curses, 'resizeterm'):
lines, cols = curses.LINES, curses.COLS
@@ -281,6 +289,7 @@ def main(stdscr):
window_funcs(stdscr)
test_userptr_without_set(stdscr)
test_userptr_memory_leak(stdscr)
+ test_userptr_segfault(stdscr)
test_resize_term(stdscr)
test_issue6243(stdscr)
finally: