Skip to content

Commit 441b1ae

Browse files
committed
Use locking for GIL build as well.
1 parent dcdb699 commit 441b1ae

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Python/_warnings.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,31 +235,23 @@ get_warnings_attr(PyInterpreterState *interp, PyObject *attr, int try_import)
235235
static inline void
236236
warnings_lock(PyInterpreterState *interp)
237237
{
238-
#ifdef Py_GIL_DISABLED
239238
WarningsState *st = warnings_get_state(interp);
240239
assert(st != NULL);
241240
_PyRecursiveMutex_Lock(&st->lock);
242-
#endif
243241
}
244242

245243
static inline void
246244
warnings_unlock(PyInterpreterState *interp)
247245
{
248-
#ifdef Py_GIL_DISABLED
249246
WarningsState *st = warnings_get_state(interp);
250247
assert(st != NULL);
251248
_PyRecursiveMutex_Unlock(&st->lock);
252-
#endif
253249
}
254250

255251
static inline bool
256252
warnings_lock_held(WarningsState *st)
257253
{
258-
#ifdef Py_GIL_DISABLED
259254
return PyMutex_IsLocked(&(st)->lock.mutex);
260-
#else
261-
return true;
262-
#endif
263255
}
264256

265257
/*[clinic input]

0 commit comments

Comments
 (0)