From 740b1e90247c2ee8c4375cbf03c961f31e92f5b1 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Wed, 4 Oct 2023 11:53:26 +0200 Subject: [PATCH] Make build work with Cython 3.x Implicit `noexcept` is deprecated, as per the migration guide for Cython 3.x: https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#exception-values-and-noexcept --- pyproject.toml | 2 +- src/esm.pyx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7a0bd79..bc2be67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "Cython<3"] +requires = ["setuptools", "wheel", "Cython"] diff --git a/src/esm.pyx b/src/esm.pyx index 5c6185a..cda9a43 100644 --- a/src/esm.pyx +++ b/src/esm.pyx @@ -1,11 +1,11 @@ cimport aho_corasick -cdef aho_corasick.ac_error_code decref_result_object(void *item, void* data): +cdef aho_corasick.ac_error_code decref_result_object(void *item, void* data) noexcept: aho_corasick.Py_DecRef(item) return aho_corasick.AC_SUCCESS cdef aho_corasick.ac_error_code append_result(void* data, - aho_corasick.ac_result* result): + aho_corasick.ac_result* result) noexcept: result_list = data result_tuple = ((result.start, result.end), result.object) result_list.append(result_tuple)