gh-135379: Add back const cast to _PyLong_IsCompact (GH-135706)

This commit is contained in:
Ken Jin 2025-06-19 19:54:21 +08:00 committed by GitHub
parent 13efe3f599
commit 1b969f6d57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,9 +125,9 @@ _PyLong_IsCompact(const PyLongObject* op) {
} }
static inline int static inline int
PyLong_CheckCompact(const PyObject *op) PyLong_CheckCompact(PyObject *op)
{ {
return PyLong_CheckExact(op) && _PyLong_IsCompact((PyLongObject *)op); return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op);
} }
#define PyUnstable_Long_IsCompact _PyLong_IsCompact #define PyUnstable_Long_IsCompact _PyLong_IsCompact