diff --git a/README.md b/README.md index 29698743..f30a498e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ will be very helpful. ### Optional Packages - [lhafile - FS Edition][2]: required to use ```.lha``` file scanner -- [cython][3]: (version >= **0.29**) required to rebuild the native module +- [cython][3]: (version >= **3.0.0**) required to rebuild the native module [1]: https://pip.pypa.io/en/stable/installation/ [2]: https://github.com/FrodeSolheim/python-lhafile diff --git a/machine/pycpu.pyx b/machine/pycpu.pyx index 7eaa57c9..8fabd704 100644 --- a/machine/pycpu.pyx +++ b/machine/pycpu.pyx @@ -41,15 +41,15 @@ cdef extern from "m68k.h": # wrapper cdef object pc_changed_func -cdef void pc_changed_func_wrapper(unsigned int new_pc): +cdef void pc_changed_func_wrapper(unsigned int new_pc) noexcept: pc_changed_func(new_pc) cdef object reset_instr_func -cdef void reset_instr_func_wrapper(): +cdef void reset_instr_func_wrapper() noexcept: reset_instr_func() cdef object instr_hook_func -cdef void instr_hook_func_wrapper(unsigned int pc): +cdef void instr_hook_func_wrapper(unsigned int pc) noexcept: instr_hook_func() # public CPUContext diff --git a/machine/pymem.pyx b/machine/pymem.pyx index 020efa56..e2db01e5 100644 --- a/machine/pymem.pyx +++ b/machine/pymem.pyx @@ -51,7 +51,7 @@ cdef check_mem_exc(): mem_callback_exc = None raise exc[0], exc[1], exc[2] -cdef void trace_func_wrapper(int mode, int width, uint addr, uint val, void *ctx): +cdef void trace_func_wrapper(int mode, int width, uint addr, uint val, void *ctx) noexcept: cdef object py_func = ctx try: py_func(chr(mode), width, addr, val) @@ -60,7 +60,7 @@ cdef void trace_func_wrapper(int mode, int width, uint addr, uint val, void *ctx mem_callback_exc = sys.exc_info() m68k_end_timeslice() -cdef void invalid_func_wrapper(int mode, int width, uint addr, void *ctx): +cdef void invalid_func_wrapper(int mode, int width, uint addr, void *ctx) noexcept: cdef object py_func = ctx try: py_func(chr(mode), width, addr) @@ -69,7 +69,7 @@ cdef void invalid_func_wrapper(int mode, int width, uint addr, void *ctx): mem_callback_exc = sys.exc_info() m68k_end_timeslice() -cdef uint special_read_func_wrapper(uint addr, void *ctx): +cdef uint special_read_func_wrapper(uint addr, void *ctx) noexcept: cdef object py_func = ctx try: return py_func(addr) @@ -79,7 +79,7 @@ cdef uint special_read_func_wrapper(uint addr, void *ctx): m68k_end_timeslice() return 0 -cdef void special_write_func_wrapper(uint addr, uint value, void *ctx): +cdef void special_write_func_wrapper(uint addr, uint value, void *ctx) noexcept: cdef object py_func = ctx try: py_func(addr, value) diff --git a/machine/pytraps.pyx b/machine/pytraps.pyx index cd5799f1..0dd4c0d2 100644 --- a/machine/pytraps.pyx +++ b/machine/pytraps.pyx @@ -13,7 +13,7 @@ cdef object trap_exc_func from cpython.exc cimport PyErr_Print -cdef void trap_wrapper(uint opcode, uint pc, void *data): +cdef void trap_wrapper(uint opcode, uint pc, void *data) noexcept: cdef object py_func = data try: py_func(opcode, pc) diff --git a/pyproject.toml b/pyproject.toml index 48ad93e0..8af73fc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "setuptools-scm", "cython"] +requires = ["setuptools", "setuptools-scm", "cython >= 3.0.0"] build-backend = "setuptools.build_meta" [project] diff --git a/setup.py b/setup.py index e16fcff5..b655bfd3 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,8 @@ from Cython import __version__ as cyver print("cython version:", cyver) - if parse_version(cyver) < parse_version("0.25"): - print("cython is too old < 0.25! please update first!") + if parse_version(cyver) < parse_version("3.0"): + print("cython is too old < 3.0! please update first!") sys.exit(1) except ImportError: print("cython is too old! please update first!") @@ -209,7 +209,7 @@ def run(self): # use cython? if use_cython: sourcefiles.append(cython_file) - extensions = cythonize(extensions) + extensions = cythonize(extensions, language_level="3str") else: sourcefiles.append(ext_file)