Patch from SF bug 570483 (Tim Northover).

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.
This commit is contained in:
Guido van Rossum 2002-06-18 16:49:45 +00:00
parent 63517577fd
commit a96b0df624
1 changed files with 6 additions and 0 deletions

View File

@ -3169,6 +3169,12 @@ def do_this_first():
except: except:
pass 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(): def test_main():
do_this_first() do_this_first()
class_docstrings() class_docstrings()