Skip to content

Commit 63ab044

Browse files
Fix build
1 parent 74eabaf commit 63ab044

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

Objects/typeobject.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5738,9 +5738,9 @@ find_name_in_mro(PyTypeObject *type, PyObject *name, int *error)
57385738
This returns a strong reference, and might set an exception.
57395739
'error' is set to: -1: error with exception; 0: ok */
57405740
static PyObject *
5741-
find_name_in_mro_new(PyObject *mro_dict, PyObject *name, int *error)
5741+
find_name_in_mro_new(PyTypeObject *type, PyObject *mro_dict, PyObject *name, int *error)
57425742
{
5743-
ASSERT_TYPE_LOCK_HELD();
5743+
ASSERT_WORLD_STOPPED_OR_NEW_TYPE(type);
57445744

57455745
PyObject *res = NULL;
57465746
if (PyDict_GetItemRef(mro_dict, name, &res) < 0) {
@@ -11311,7 +11311,7 @@ update_one_slot(PyTypeObject *type, pytype_slotdef *p, PyObject *mro_dict)
1131111311
if (mro_dict == NULL) {
1131211312
descr = find_name_in_mro(type, p->name_strobj, &error);
1131311313
} else {
11314-
descr = find_name_in_mro_new(mro_dict, p->name_strobj, &error);
11314+
descr = find_name_in_mro_new(type, mro_dict, p->name_strobj, &error);
1131511315
}
1131611316
if (descr == NULL) {
1131711317
if (error == -1) {
@@ -11458,12 +11458,9 @@ update_slot(PyTypeObject *type, PyObject *name)
1145811458
static int
1145911459
fixup_slot_dispatchers(PyTypeObject *type)
1146011460
{
11461-
int res = 0;
11461+
ASSERT_WORLD_STOPPED_OR_NEW_TYPE(type);
1146211462

11463-
// This lock isn't strictly necessary because the type has not been
11464-
// exposed to anyone else yet, but update_ont_slot calls find_name_in_mro
11465-
// where we'd like to assert that the type is locked.
11466-
BEGIN_TYPE_LOCK();
11463+
int res = 0;
1146711464

1146811465
PyObject *mro = Py_NewRef(lookup_tp_mro(type));
1146911466

@@ -11505,8 +11502,6 @@ fixup_slot_dispatchers(PyTypeObject *type)
1150511502
finish:
1150611503
Py_XDECREF(mro_dict);
1150711504
Py_DECREF(mro);
11508-
11509-
END_TYPE_LOCK();
1151011505
return res;
1151111506
}
1151211507

0 commit comments

Comments
 (0)