]> granicus.if.org Git - python/commitdiff
Add some regression tests of coredump bugs in funcobject.c 2.31. Also
authorBarry Warsaw <barry@python.org>
Fri, 19 Jan 2001 19:55:12 +0000 (19:55 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 19 Jan 2001 19:55:12 +0000 (19:55 +0000)
added a test of a coredump that would occur when del'ing
func_defaults (put here for convenience).

Lib/test/test_funcattrs.py

index 9d3ec18a2f85f874ced5ab4e44fe9cb61f25aa1c..9c07a8fee6d34023224e74f097c11350703e8c13 100644 (file)
@@ -138,3 +138,19 @@ try:
     eff.id.foo
 except AttributeError: pass
 else: raise TestFailed
+
+# Regression test for a crash in pre-2.1a1
+def another():
+    pass
+del another.__dict__
+del another.func_dict
+another.func_dict = None
+
+try:
+    del another.bar
+except AttributeError: pass
+else: raise TestFailed
+
+# This isn't specifically related to function attributes, but it does test a
+# core dump regression in funcobject.c
+del another.func_defaults