Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter #104072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some asserts.
  • Loading branch information
ericsnowcurrently committed May 1, 2023
commit f2fb5a48ecf6878d47e4e48b706551f70f15e0ed
11 changes: 9 additions & 2 deletions 11 Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7041,16 +7041,23 @@ _PyStaticType_InitBuiltin(PyInterpreterState *interp, PyTypeObject *self)
{
assert(_Py_IsImmortal((PyObject *)self));
assert(!(self->tp_flags & Py_TPFLAGS_HEAPTYPE));
assert(!(self->tp_flags & Py_TPFLAGS_MANAGED_DICT));
assert(!(self->tp_flags & Py_TPFLAGS_MANAGED_WEAKREF));

int ismain = _Py_IsMainInterpreter(interp);
if (self->tp_flags & Py_TPFLAGS_READY) {
assert(!ismain);
assert(self->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN);
assert(_PyType_CheckConsistency(self));
assert(self->tp_flags & Py_TPFLAGS_VALID_VERSION_TAG);

/* Per-interpreter tp_subclasses is done lazily.
Otherwise we would initialize it here. */

assert(_PyType_CheckConsistency(self));
return 0;
}

assert(_Py_IsMainInterpreter(interp));
assert(ismain);

self->tp_flags |= _Py_TPFLAGS_STATIC_BUILTIN;
self->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.