@@ -6607,7 +6607,7 @@ compatible_for_assignment(PyTypeObject* oldto, PyTypeObject* newto, const char*
66076607
66086608
66096609static int
6610- object_set_class_world_stopped (PyObject * self , PyTypeObject * newto , PyTypeObject * * oldto_p )
6610+ object_set_class_world_stopped (PyObject * self , PyTypeObject * newto )
66116611{
66126612 PyTypeObject * oldto = Py_TYPE (self );
66136613
@@ -6682,13 +6682,7 @@ object_set_class_world_stopped(PyObject *self, PyTypeObject *newto, PyTypeObject
66826682 }
66836683 }
66846684
6685- // If we raced after materialization and replaced the dict
6686- // then the materialized dict should no longer have the
6687- // inline values in which case detach is a nop.
6688- // Note: we don't need to lock here because the world should be stopped.
6689-
6690- assert (_PyObject_GetManagedDict (self ) == dict ||
6691- dict -> ma_values != _PyObject_InlineValues (self ));
6685+ assert (_PyObject_GetManagedDict (self ) == dict );
66926686
66936687 if (_PyDict_DetachFromObject (dict , self ) < 0 ) {
66946688 return -1 ;
@@ -6701,8 +6695,6 @@ object_set_class_world_stopped(PyObject *self, PyTypeObject *newto, PyTypeObject
67016695
67026696 Py_SET_TYPE (self , newto );
67036697
6704- * oldto_p = oldto ;
6705-
67066698 return 0 ;
67076699 }
67086700 else {
@@ -6734,12 +6726,10 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
67346726
67356727#ifdef Py_GIL_DISABLED
67366728 PyInterpreterState * interp = _PyInterpreterState_GET ();
6737- // The real Py_TYPE(self) (`oldto`) may have changed from
6738- // underneath us in another thread, so we stop the world.
67396729 _PyEval_StopTheWorld (interp );
67406730#endif
6741- PyTypeObject * oldto ;
6742- int res = object_set_class_world_stopped (self , newto , & oldto );
6731+ PyTypeObject * oldto = Py_TYPE ( self ) ;
6732+ int res = object_set_class_world_stopped (self , newto );
67436733#ifdef Py_GIL_DISABLED
67446734 _PyEval_StartTheWorld (interp );
67456735#endif
0 commit comments