Skip to content

Commit

Permalink
Fix detection of PyInterpreterState_GetID in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Jan 14, 2024
1 parent 693c8b0 commit e31e8e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,6 @@ def build_extension(self, ext):
if self.compiler.compiler_type == "msvc":
ext.define_macros.append(("WIN32", 1))

# check if `PyInterpreterState_GetID` is defined
if self._check_getid():
ext.define_macros.append(("HAS_PYINTERPRETERSTATE_GETID", 1))

# build the rest of the extension as normal
ext._needs_stub = False

Expand Down Expand Up @@ -490,6 +486,10 @@ def build_extensions(self):
cython_args["compiler_directives"]["boundscheck"] = False
cython_args["compiler_directives"]["wraparound"] = False

# check if `PyInterpreterState_GetID` is defined
if self._check_getid():
self.compiler.define_macros.append(("HAS_PYINTERPRETERSTATE_GETID", 1))

# check if we can build platform-specific code
if self.target_cpu == "x86" or self.target_cpu == "x86_64":
if not self._simd_disabled["AVX2"] and self._check_avx2():
Expand Down

0 comments on commit e31e8e6

Please sign in to comment.