diff --git a/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst b/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst new file mode 100644 index 00000000000000..3521dd3005486b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst @@ -0,0 +1 @@ +Fixed an issue where the macOS SDK path wouldn't be discovered by setup.py, meaning _tkinter failed to build on macOS 10.15. \ No newline at end of file diff --git a/setup.py b/setup.py index 02f523c42d355f..216defe51f2959 100644 --- a/setup.py +++ b/setup.py @@ -1769,16 +1769,15 @@ def detect_tkinter_darwin(self): for F in framework_dirs: # both Tcl.framework and Tk.framework should be present - for fw in 'Tcl', 'Tk': if is_macosx_sdk_path(F): - if not exists(join(sysroot, F[1:], fw + '.framework')): - break + framework_path = join(sysroot, F[1:]) else: - if not exists(join(F, fw + '.framework')): - break + framework_path = F + if not exists(join(framework_path, fw + '.framework')): + break else: - # ok, F is now directory with both frameworks. Continure + # ok, framework_path is now directory with both frameworks. Continue # building break else: @@ -1791,11 +1790,10 @@ def detect_tkinter_darwin(self): # the -F option to gcc, which specifies a framework lookup path. # include_dirs = [ - join(F, fw + '.framework', H) + join(framework_path, fw + '.framework', H) for fw in ('Tcl', 'Tk') for H in ('Headers', 'Versions/Current/PrivateHeaders') ] - # For 8.4a2, the X11 headers are not included. Rather than include a # complicated search, this is a hard-coded path. It could bail out # if X11 libs are not found...