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 index 00000000000..3763e8404c3 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-12-25-10-06-59.gh-issue-101778.JfhRkx.rst @@ -0,0 +1,2 @@ +Fix build error when there's a dangling symlink in the directory containing +``ffi.h``. diff --git a/setup.py b/setup.py index 4f122b62e0e..ad8fb81b218 100644 --- 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