From 1b969f6d577bc1480b708e6604f708ab740f8715 Mon Sep 17 00:00:00 2001 From: Ken Jin Date: Thu, 19 Jun 2025 19:54:21 +0800 Subject: [PATCH] gh-135379: Add back const cast to _PyLong_IsCompact (GH-135706) --- Include/cpython/longintrepr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index 9f12298d4fc..19a57284e0e 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -125,9 +125,9 @@ _PyLong_IsCompact(const PyLongObject* op) { } 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