mirror of https://github.com/python/cpython
bpo-11063: Handle uuid.h being in default include path (GH-4565)
find_file() returns an empty list if it finds the requested header on the standard include path, so header existence checks need to be explicitly against "is not None".
This commit is contained in:
parent
cef88b9c15
commit
53efbf3977
3
setup.py
3
setup.py
|
@ -1680,12 +1680,11 @@ class PyBuildExt(build_ext):
|
||||||
|
|
||||||
# Build the _uuid module if possible
|
# Build the _uuid module if possible
|
||||||
uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"])
|
uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"])
|
||||||
if uuid_incs:
|
if uuid_incs is not None:
|
||||||
if self.compiler.find_library_file(lib_dirs, 'uuid'):
|
if self.compiler.find_library_file(lib_dirs, 'uuid'):
|
||||||
uuid_libs = ['uuid']
|
uuid_libs = ['uuid']
|
||||||
else:
|
else:
|
||||||
uuid_libs = []
|
uuid_libs = []
|
||||||
if uuid_incs:
|
|
||||||
self.extensions.append(Extension('_uuid', ['_uuidmodule.c'],
|
self.extensions.append(Extension('_uuid', ['_uuidmodule.c'],
|
||||||
libraries=uuid_libs,
|
libraries=uuid_libs,
|
||||||
include_dirs=uuid_incs))
|
include_dirs=uuid_incs))
|
||||||
|
|
Loading…
Reference in New Issue