From 3f580bf03f9ec2e11487a03776a530e4bf6c1bdc Mon Sep 17 00:00:00 2001 From: Cheruku Sri Charan Reddy <185475071+sricharanreddycheruku@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:25:40 +0000 Subject: [PATCH] fix: support Py_NewRef calls on Python 3.9 --- src/hyperscan/extension.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hyperscan/extension.c b/src/hyperscan/extension.c index e072d10..68f099e 100644 --- a/src/hyperscan/extension.c +++ b/src/hyperscan/extension.c @@ -9,6 +9,14 @@ #include #include +#if PY_VERSION_HEX < 0x030A0000 +static inline PyObject *Py_NewRef(PyObject *obj) +{ + Py_INCREF(obj); + return obj; +} +#endif + #ifdef Py_GIL_DISABLED typedef struct { PyThread_type_lock lock;