]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-101778: Fix build error when there's a dangling symlink in the directory...
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 26 Dec 2023 09:05:48 +0000 (10:05 +0100)
committerGitHub <noreply@github.com>
Tue, 26 Dec 2023 09:05:48 +0000 (10:05 +0100)
gh-101778: Fix build error when there's a dangling symlink in the directory containing "ffi.h"

Misc/NEWS.d/next/Build/2023-12-25-10-06-59.gh-issue-101778.JfhRkx.rst [new file with mode: 0644]
setup.py

diff --git a/Misc/NEWS.d/next/Build/2023-12-25-10-06-59.gh-issue-101778.JfhRkx.rst b/Misc/NEWS.d/next/Build/2023-12-25-10-06-59.gh-issue-101778.JfhRkx.rst
new file mode 100644 (file)
index 0000000..3763e84
--- /dev/null
@@ -0,0 +1,2 @@
+Fix build error when there's a dangling symlink in the directory containing
+``ffi.h``.
index 4f122b62e0e708fa4feff0ae94cf9949805b35d2..ad8fb81b218ebd0dac8a8fdef5c0fb3690a48a3b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -224,6 +224,7 @@ def is_macosx_sdk_path(path):
 
 def grep_headers_for(function, headers):
     for header in headers:
+        if not os.path.exists(header): continue
         with open(header, 'r', errors='surrogateescape') as f:
             if function in f.read():
                 return True