Skip to content

Commit 3b85c9e

Browse files
committed
add empty macro to remove Py_GIL_DISABLED macro guard
1 parent 0b8ebb6 commit 3b85c9e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Objects/typeobject.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ type_lock_allow_release(void)
189189
#define types_world_is_stopped() 1
190190
#define types_stop_world()
191191
#define types_start_world()
192+
#define type_lock_prevent_release()
193+
#define type_lock_allow_release()
192194

193195
#endif
194196

@@ -1920,16 +1922,12 @@ type_set_bases_unlocked(PyTypeObject *type, PyObject *new_bases, PyTypeObject *b
19201922
assert(old_bases != NULL);
19211923
PyTypeObject *old_base = type->tp_base;
19221924

1923-
#ifdef Py_GIL_DISABLED
19241925
type_lock_prevent_release();
1925-
#endif
19261926
types_stop_world();
19271927
set_tp_bases(type, Py_NewRef(new_bases), 0);
19281928
type->tp_base = (PyTypeObject *)Py_NewRef(best_base);
19291929
types_start_world();
1930-
#ifdef Py_GIL_DISABLED
19311930
type_lock_allow_release();
1932-
#endif
19331931

19341932
PyObject *temp = PyList_New(0);
19351933
if (temp == NULL) {
@@ -1990,16 +1988,12 @@ type_set_bases_unlocked(PyTypeObject *type, PyObject *new_bases, PyTypeObject *b
19901988
if (lookup_tp_bases(type) == new_bases) {
19911989
assert(type->tp_base == best_base);
19921990

1993-
#ifdef Py_GIL_DISABLED
19941991
type_lock_prevent_release();
1995-
#endif
19961992
types_stop_world();
19971993
set_tp_bases(type, old_bases, 0);
19981994
type->tp_base = old_base;
19991995
types_start_world();
2000-
#ifdef Py_GIL_DISABLED
20011996
type_lock_allow_release();
2002-
#endif
20031997

20041998
Py_DECREF(new_bases);
20051999
Py_DECREF(best_base);

0 commit comments

Comments
 (0)