]> granicus.if.org Git - python/commitdiff
bpo-11063: Handle uuid.h being in default include path (GH-4565)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 26 Nov 2017 03:04:46 +0000 (13:04 +1000)
committerGitHub <noreply@github.com>
Sun, 26 Nov 2017 03:04:46 +0000 (13:04 +1000)
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".

setup.py

index 0678ddec4149ec8c2b9e0cfab17dfc18f38482ef..c22de17f95339642ab6f80a5ba62e6ba3e9710a3 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1680,12 +1680,11 @@ class PyBuildExt(build_ext):
 
         # Build the _uuid module if possible
         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'):
                 uuid_libs = ['uuid']
             else:
                 uuid_libs = []
-        if uuid_incs:
             self.extensions.append(Extension('_uuid', ['_uuidmodule.c'],
                                    libraries=uuid_libs,
                                    include_dirs=uuid_incs))