Skip to content

Commit de4c4ea

Browse files
committed
Fix compiler warning on GIL-ful builds.
1 parent d60f2e2 commit de4c4ea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,7 +3241,10 @@ PyObject *
32413241
PyCData_get(ctypes_state *st, PyObject *type, GETFUNC getfunc, PyObject *src,
32423242
Py_ssize_t index, Py_ssize_t size, char *adr)
32433243
{
3244+
#ifdef Py_GIL_DISABLED
3245+
// This isn't used if the GIL is enabled, so it causes a compiler warning.
32443246
CDataObject *cdata = (CDataObject *)src;
3247+
#endif
32453248
if (getfunc) {
32463249
LOCK_PTR(cdata);
32473250
PyObject *res = getfunc(adr, size);

0 commit comments

Comments
 (0)