Skip to content

Commit 6b827cb

Browse files
committed
Fix PyCXX check -- if import passes, we should assume that including it will also
1 parent 1b3106c commit 6b827cb

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

setupext.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -695,17 +695,12 @@ def check(self):
695695
return self._check_for_pkg_config(
696696
'PyCXX', 'CXX/Extensions.hxx', min_version='6.2.4')
697697
except CheckFailed as e:
698-
# Since there is no .pc file for PyCXX upstream, many
699-
# distros don't package it either. We don't necessarily
700-
# need to fall back to a local build in that scenario if
701-
# the header files can be found.
702-
base_include_dirs = [
703-
os.path.join(x, 'include') for x in get_base_dirs()]
704-
if has_include_file(base_include_dirs, 'CXX/Extensions.hxx'):
705-
return 'Using system CXX (version unknown, no pkg-config info)'
706-
else:
707-
self.__class__.found_external = False
708-
return str(e) + ' Using local copy.'
698+
# It's ok to just proceed here, since the `import CXX`
699+
# worked above, and PyCXX (at least upstream) ensures that
700+
# its header files are on the default distutils include
701+
# path (either in a standard C place such as /usr/include,
702+
# or in /usr/include/pythonX.Y.
703+
return 'Using system CXX (version unknown, no pkg-config info)'
709704

710705
def add_flags(self, ext):
711706
if self.found_external and not 'sdist' in sys.argv:

0 commit comments

Comments
 (0)