]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
crash_in_get_sf736892(): A test of SF 736892, forcing function to act
authorBarry Warsaw <barry@python.org>
Thu, 29 May 2003 15:14:52 +0000 (15:14 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 29 May 2003 15:14:52 +0000 (15:14 +0000)
like an unbound method dumps core.

Lib/test/test_descr.py

index 0b7d69b594d58022a8d6c198549c93794a218616..5d5ccc3bd009ac81553ffcacc3484816e90c3438 100644 (file)
@@ -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"