Skip to content

Commit 26ebd12

Browse files
committed
Fix compiler warning on Python 3.8
1 parent e0adfa3 commit 26ebd12

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/test_pythoncapi_compat_cext.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ check_module_attr(PyObject *module, const char *name, PyObject *expected)
426426
}
427427

428428

429+
#if !(defined(Py_LIMITED_API) && PY_VERSION_HEX < 0x030A0000)
429430
// test PyModule_AddType()
430431
static int
431432
test_module_add_type(PyObject *module)
432433
{
433-
#if !(defined(Py_LIMITED_API) && PY_VERSION_HEX < 0x030A0000)
434434
PyTypeObject *type = &PyUnicode_Type;
435435
const char *type_name = "str";
436436
#ifdef CHECK_REFCNT
@@ -448,9 +448,9 @@ test_module_add_type(PyObject *module)
448448
return -1;
449449
}
450450
ASSERT_REFCNT(Py_REFCNT(_PyObject_CAST(type)) == refcnt);
451-
#endif // !(defined(Py_LIMITED_API) && PY_VERSION_HEX < 0x030A0000)
452451
return 0;
453452
}
453+
#endif // !(defined(Py_LIMITED_API) && PY_VERSION_HEX < 0x030A0000)
454454

455455

456456
// test PyModule_AddObjectRef()
@@ -534,9 +534,11 @@ test_module(PyObject *Py_UNUSED(module), PyObject* Py_UNUSED(ignored))
534534
}
535535
assert(PyModule_Check(module));
536536

537+
#if !(defined(Py_LIMITED_API) && PY_VERSION_HEX < 0x030A0000)
537538
if (test_module_add_type(module) < 0) {
538539
goto error;
539540
}
541+
#endif
540542
if (test_module_addobjectref(module) < 0) {
541543
goto error;
542544
}

0 commit comments

Comments
 (0)