]> granicus.if.org Git - python/commitdiff
Patch from SF bug 570483 (Tim Northover).
authorGuido van Rossum <guido@python.org>
Tue, 18 Jun 2002 16:49:45 +0000 (16:49 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 18 Jun 2002 16:49:45 +0000 (16:49 +0000)
In a fresh interpreter, type.mro(tuple) would segfault, because
PyType_Ready() isn't called for tuple yet.  To fix, call
PyType_Ready(type) if type->tp_dict is NULL.

Lib/test/test_descr.py

index 852115be216491cbac58920bfdd8cfc87b782282..2129a7b7c812f7577b63e303c43ba33ee4fe3f02 100644 (file)
@@ -3169,6 +3169,12 @@ def do_this_first():
     except:
         pass
 
+    if verbose:
+        print "Testing SF bug 570483..."
+    # Another segfault only when run early
+    # (before PyType_Ready(tuple) is called)
+    type.mro(tuple)
+
 def test_main():
     do_this_first()
     class_docstrings()