Skip to content
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
Lock the dict if we're not in a stop-the-world event
  • Loading branch information
colesbury committed Mar 5, 2026
commit d1012c3c7112c7dfff26b7fdb637130306ef80fd
6 changes: 5 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7568,7 +7568,11 @@ object_set_class_world_stopped(PyObject *self, PyTypeObject *newto)

assert(_PyObject_GetManagedDict(self) == dict);

if (_PyDict_DetachFromObject(dict, self) < 0) {
int err;
Py_BEGIN_CRITICAL_SECTION(dict);
err = _PyDict_DetachFromObject(dict, self);
Py_END_CRITICAL_SECTION();
if (err < 0) {
return -1;
}

Expand Down
Loading