[3.11] gh-101778: Fix build error when there's a dangling symlink in the directory containing "ffi.h" (#113466)

gh-101778: Fix build error when there's a dangling symlink in the directory containing "ffi.h"
This commit is contained in:
Ronald Oussoren 2023-12-26 10:05:48 +01:00 committed by GitHub
parent 4b358d754c
commit 0eea5c04b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Fix build error when there's a dangling symlink in the directory containing
``ffi.h``.

View File

@ -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