File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2929if TYPE_CHECKING :
3030 from collections .abc import Iterable , Iterator
3131
32- Py_LIMITED_API = 0x03100000
32+ Py_LIMITED_API : None | int = 0x03100000
3333
3434HEADER_PARSE_PATHS = ("tcod/" , "libtcod/src/libtcod/" )
3535HEADER_PARSE_EXCLUDES = ("gl2_ext_.h" , "renderer_gl_internal.h" , "event.h" )
@@ -167,9 +167,14 @@ def walk_sources(directory: str) -> Iterator[str]:
167167library_dirs : list [str ] = [* build_sdl .library_dirs ]
168168define_macros : list [tuple [str , Any ]] = []
169169
170- if "PYODIDE" not in os .environ :
170+ if "free-threading build" in sys .version :
171+ Py_LIMITED_API = None
172+ if "PYODIDE" in os .environ :
171173 # Unable to apply Py_LIMITED_API to Pyodide in cffi<=1.17.1
172174 # https://github.com/python-cffi/cffi/issues/179
175+ Py_LIMITED_API = None
176+
177+ if Py_LIMITED_API :
173178 define_macros .append (("Py_LIMITED_API" , Py_LIMITED_API ))
174179
175180sources += walk_sources ("tcod/" )
You can’t perform that action at this time.
0 commit comments