From d5536b727e8d4edc54896a90dfcc73a3dc1e004b Mon Sep 17 00:00:00 2001 From: Aleksandr Mikhnenko Date: Wed, 17 Dec 2025 14:46:24 +0300 Subject: [PATCH 1/2] support cython 3.1+ --- fastsnmp/snmp_parser.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastsnmp/snmp_parser.pyx b/fastsnmp/snmp_parser.pyx index 403baf2..77d2b87 100644 --- a/fastsnmp/snmp_parser.pyx +++ b/fastsnmp/snmp_parser.pyx @@ -7,7 +7,7 @@ import cython from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM -from cpython.int cimport PyInt_FromLong +from cpython.int cimport PyLong_FromLong from cpython.ref cimport Py_INCREF from cpython.exc cimport PyErr_SetString from cpython.unicode cimport PyUnicode_DecodeASCII @@ -258,7 +258,7 @@ cdef inline tuple objectid_decode_tuple(char *stream, size_t stream_len): ret = PyTuple_New(result_len) for i in range(result_len): - val = PyInt_FromLong(result[i]) + val = PyLong_FromLong(result[i]) Py_INCREF(val) PyTuple_SET_ITEM(ret, i, val) return ret From 244e1cd89d0052a5ba60482e44efe04a3bfc7429 Mon Sep 17 00:00:00 2001 From: Aleksandr Mikhnenko Date: Thu, 18 Dec 2025 11:52:09 +0300 Subject: [PATCH 2/2] fix import --- fastsnmp/snmp_parser.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastsnmp/snmp_parser.pyx b/fastsnmp/snmp_parser.pyx index 77d2b87..fc2ac48 100644 --- a/fastsnmp/snmp_parser.pyx +++ b/fastsnmp/snmp_parser.pyx @@ -7,7 +7,7 @@ import cython from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM -from cpython.int cimport PyLong_FromLong +from cpython.long cimport PyLong_FromLong from cpython.ref cimport Py_INCREF from cpython.exc cimport PyErr_SetString from cpython.unicode cimport PyUnicode_DecodeASCII