Commit 3b0e42ea authored by Marius Wachtler's avatar Marius Wachtler

handle duplicate PyType_Ready call

parent 3e2b8eb3
......@@ -3404,6 +3404,12 @@ extern "C" void PyType_GiveHcAttrsDictDescr(PyTypeObject* cls) noexcept {
extern "C" int PyType_Ready(PyTypeObject* cls) noexcept {
ASSERT(!cls->is_pyston_class, "should not call this on Pyston classes");
// if this type is already in ready state we are finished.
if (cls->tp_flags & Py_TPFLAGS_READY) {
assert(cls->tp_dict != NULL);
return 0;
}
gc::registerNonheapRootObject(cls, sizeof(PyTypeObject));
// unhandled fields:
......
......@@ -29,3 +29,9 @@ print y
print __name__
print __import__("import_target") is import_target
import sys
import _multiprocessing
del _multiprocessing
del sys.modules["_multiprocessing"]
import _multiprocessing
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment