Skip to content

Commit 8b11371

Browse files
committed
Fix GSSAPI detection on macOS Big Sur
CPython on macOS Big Sur has a bug in the ctypes.util.find_library function. This has been fixed recently but has not made its way to an actual release yet. This change adds a fallback GSS framework path to try incase ctypes fails to find the path.
1 parent 5ee095e commit 8b11371

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ def get_output(*args, **kwargs):
162162
main_path = ""
163163
if main_lib is None and osx_has_gss_framework:
164164
main_lib = ctypes.util.find_library('GSS')
165+
166+
if not main_lib:
167+
# https://github.com/pythongssapi/python-gssapi/issues/235
168+
# CPython has a bug on Big Sur where find_library will fail to
169+
# find the library path of shared frameworks. This has been fixed
170+
# in newer versions but we have this fallback in case an older
171+
# version is still in use. This fix is expected to be included in
172+
# 3.8.8 and 3.9.2.
173+
main_lib = '/System/Library/Frameworks/GSS.framework/GSS'
165174
elif os.environ.get('MINGW_PREFIX'):
166175
main_lib = os.environ.get('MINGW_PREFIX')+'/bin/libgss-3.dll'
167176
elif sys.platform == 'msys':

0 commit comments

Comments
 (0)