From 94c8b73a0c9c0815f641d0b80e7e76bf102a54ae Mon Sep 17 00:00:00 2001 From: sirfz Date: Mon, 9 Oct 2023 14:43:56 +0300 Subject: [PATCH] updated cython dependency + version bump --- setup.py | 3 ++- tesserocr.pyx | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 0cd321d..2338b3c 100644 --- a/setup.py +++ b/setup.py @@ -319,6 +319,7 @@ def finalize_options(self): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Cython', @@ -328,5 +329,5 @@ def finalize_options(self): cmdclass={'build_ext': my_build_ext}, ext_modules=[make_extension()], test_suite='tests', - setup_requires=['Cython>=0.23,<3.0.0'], + setup_requires=['Cython>=0.23,<3.1.0'], ) diff --git a/tesserocr.pyx b/tesserocr.pyx index 6c392f3..333e3ea 100644 --- a/tesserocr.pyx +++ b/tesserocr.pyx @@ -18,7 +18,7 @@ tesseract 3.04.00 ['eng', 'osd', 'equ']) """ -__version__ = '2.6.1' +__version__ = '2.6.2' import os from io import BytesIO @@ -421,7 +421,7 @@ cdef class PyPageIterator: cdef PageIterator *_piter @staticmethod - cdef PyPageIterator createPageIterator(PageIterator *piter): + cdef PyPageIterator createPageIterator(PageIterator *piter) noexcept: cdef PyPageIterator pyiter = PyPageIterator.__new__(PyPageIterator) pyiter._piter = piter return pyiter @@ -1091,7 +1091,7 @@ cdef class PyChoiceIterator: cdef ChoiceIterator *_citer @staticmethod - cdef PyChoiceIterator create(ChoiceIterator *citer): + cdef PyChoiceIterator create(ChoiceIterator *citer) noexcept: cdef PyChoiceIterator pyciter = PyChoiceIterator.__new__(PyChoiceIterator) pyciter._citer = citer return pyciter @@ -1246,11 +1246,11 @@ cdef class PyTessBaseAPI: self._baseapi.SetPageSegMode(psm) return ret - cdef void _end_api(self) nogil: + cdef void _end_api(self) noexcept nogil: self._destroy_pix() self._baseapi.End() - cdef void _destroy_pix(self) nogil: + cdef void _destroy_pix(self) noexcept nogil: if self._pix != NULL: pixDestroy(&self._pix) self._pix = NULL @@ -2515,7 +2515,7 @@ cdef class PyTessBaseAPI: cdef char *_image_to_text(Pix *pix, cchar_t *lang, const PageSegMode pagesegmode, - cchar_t *path, OcrEngineMode oem) nogil: + cchar_t *path, OcrEngineMode oem) noexcept nogil: cdef: TessBaseAPI baseapi char *text