From be1eb0c8f4a0c7514ec2050f4482ec5ad1a589bb Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 29 May 2003 15:14:52 +0000 Subject: [PATCH] crash_in_get_sf736892(): A test of SF 736892, forcing function to act like an unbound method dumps core. --- Lib/test/test_descr.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 0b7d69b594d5..5d5ccc3bd009 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3166,6 +3166,19 @@ def weakref_segfault(): del o +def crash_in_get_sf736892(): + def func(): + pass + + try: + f = func.__get__(None) + except TypeError: + pass + else: + # should not get here + f(1) # crash + + def test_main(): weakref_segfault() # Must be first, somehow class_docstrings() @@ -3231,6 +3244,7 @@ def test_main(): funnynew() subclass_right_op() dict_type_with_metaclass() + crash_in_get_sf736892() if verbose: print "All OK" -- 2.47.3