fix compile warning on pre-3.12 debug builds

This commit is contained in:
David Hewitt 2023-08-18 22:15:29 +01:00
parent 82b1e55e2b
commit 7fce07935c
2 changed files with 15 additions and 4 deletions

View File

@ -0,0 +1 @@
Fix compile warning for unreachable expression on debug builds before 3.12.

View File

@ -500,9 +500,14 @@ pub unsafe fn Py_INCREF(op: *mut PyObject) {
}
#[cfg(any(
not(Py_LIMITED_API),
all(Py_LIMITED_API, not(Py_3_12)),
all(py_sys_config = "Py_REF_DEBUG", Py_3_12, not(Py_LIMITED_API))
all(
not(Py_LIMITED_API),
any(
not(py_sys_config = "Py_REF_DEBUG"),
all(py_sys_config = "Py_REF_DEBUG", Py_3_12),
)
),
))]
{
#[cfg(all(Py_3_12, target_pointer_width = "64"))]
@ -560,9 +565,14 @@ pub unsafe fn Py_DECREF(op: *mut PyObject) {
}
#[cfg(any(
not(Py_LIMITED_API),
all(Py_LIMITED_API, not(Py_3_12)),
all(py_sys_config = "Py_REF_DEBUG", Py_3_12, not(Py_LIMITED_API))
all(
not(Py_LIMITED_API),
any(
not(py_sys_config = "Py_REF_DEBUG"),
all(py_sys_config = "Py_REF_DEBUG", Py_3_12),
)
),
))]
{
#[cfg(Py_3_12)]