Commit 17deca45 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño Committed by Kirill Smelkov

setup: Fix `wendelin_cy_searh_in_dirs` for Cython 3.

The interface of the function `search_include_directories` has changed
in Cython 3.0a7 in https://github.com/cython/cython/commit/f3f7b612.
This updates the replacement used by wendelin so that it works for
both newer and older versions.

Note that wendelin.core still does not work with Cython >= 3, as that
version refuses to compile Python functions that can throw C++
exceptions (apparently, mixing C++ exceptions and Cython-generated
code is not considered safe).

/reviewed-by @kirr
/reviewed-on !24
parent 5578aacd
...@@ -37,11 +37,11 @@ PY3 = (sys.version_info.major >= 3) ...@@ -37,11 +37,11 @@ PY3 = (sys.version_info.major >= 3)
# see wendelin.py for details. # see wendelin.py for details.
from Cython.Compiler.Main import Context as CyContext from Cython.Compiler.Main import Context as CyContext
cy_search_inc_dirs = CyContext.search_include_directories cy_search_inc_dirs = CyContext.search_include_directories
def wendelin_cy_searh_in_dirs(self, qualified_name, suffix, pos, include=False, sys_path=False): def wendelin_cy_searh_in_dirs(self, qualified_name, suffix=None, source_pos=None, include=False, sys_path=False, **kwargs):
_ = qualified_name.split('.') _ = qualified_name.split('.')
if len(_) >= 1 and _[0] == "wendelin": if len(_) >= 1 and _[0] == "wendelin":
qualified_name = '.'.join(_[1:]) qualified_name = '.'.join(_[1:])
return cy_search_inc_dirs(self, qualified_name, suffix, pos, include, sys_path) return cy_search_inc_dirs(self, qualified_name, suffix, source_pos, include, sys_path, **kwargs)
CyContext.search_include_directories = wendelin_cy_searh_in_dirs CyContext.search_include_directories = wendelin_cy_searh_in_dirs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment