From 066724a3756f5df07d5e1fa3ba467c6d63ebb862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 1 Jan 2025 11:49:36 +0100 Subject: [PATCH] PyLong_AsLong in convert.pxd see #169 --- cypari2/convert.pxd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypari2/convert.pxd b/cypari2/convert.pxd index a2b54da..e6ff243 100644 --- a/cypari2/convert.pxd +++ b/cypari2/convert.pxd @@ -1,7 +1,7 @@ from .paridecl cimport (GEN, t_COMPLEX, dbltor, real_0_bit, stoi, cgetg, set_gel, gen_0) from .gen cimport Gen -from cpython.int cimport PyInt_AS_LONG +from cpython.long cimport PyLong_AsLong from cpython.float cimport PyFloat_AS_DOUBLE from cpython.complex cimport PyComplex_RealAsDouble, PyComplex_ImagAsDouble from cpython.longintrepr cimport py_long @@ -58,7 +58,7 @@ cdef inline GEN doubles_to_COMPLEX(double re, double im) noexcept: # Conversion Python -> PARI cdef inline GEN PyInt_AS_GEN(x) except? NULL: - return stoi(PyInt_AS_LONG(x)) + return stoi(PyLong_AsLong(x)) cdef GEN PyLong_AS_GEN(py_long x) noexcept