Skip to content

Commit 645efb9

Browse files
committed
gh-115436: Avoid falling back to deprecated Apple-supplied Tcl/Tk 8.5 on macOS
1 parent 3fcea41 commit 645efb9

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Avoid falling back to the deprecated Apple-supplied system Tcl/Tk 8.5 on
2+
macOS builds as this version is known to have many critical problems and
3+
causes Python test suite failures. This last-ditch fallback behavior was
4+
removed in Python 3.11 but is still causing problems for users and Python
5+
release testing for older security-fix-only branches like this one. With
6+
this change, building of `_tkinter` on macOS will be skipped if no other
7+
versions of Tcl/Tk can be found.

setup.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1867,8 +1867,7 @@ def detect_tkinter_darwin(self):
18671867
# Tcl and Tk frameworks installed in /Library/Frameworks.
18681868
# 2. Build and link using a user-specified macOS SDK so that the
18691869
# built Python can be exported to other systems. In this case,
1870-
# search only the SDK's /Library/Frameworks (normally empty)
1871-
# and /System/Library/Frameworks.
1870+
# search only the SDK's /Library/Frameworks (normally empty).
18721871
#
18731872
# Any other use case should be able to be handled explicitly by
18741873
# using the options described above in detect_tkinter_explicitly().
@@ -1888,6 +1887,10 @@ def detect_tkinter_darwin(self):
18881887
# all possible by installing a newer version of Tcl and Tk in
18891888
# /Library/Frameworks before building Python without
18901889
# an explicit SDK or by configuring build arguments explicitly.
1890+
# CHANGED: we no longer fall back to searching for the
1891+
# Apple-supplied Tcl and Tk 8.5 in /System/Library/Frameworks
1892+
# as their use causes too many problems for users. It seems
1893+
# better to just skip building _tkinter at all in that case.
18911894

18921895
from os.path import join, exists
18931896

@@ -1898,17 +1901,13 @@ def detect_tkinter_darwin(self):
18981901
# Only search there.
18991902
framework_dirs = [
19001903
join(sysroot, 'Library', 'Frameworks'),
1901-
join(sysroot, 'System', 'Library', 'Frameworks'),
19021904
]
19031905
else:
19041906
# Use case #1: no explicit SDK selected.
19051907
# Search the local system-wide /Library/Frameworks,
1906-
# not the one in the default SDK, otherwise fall back to
1907-
# /System/Library/Frameworks whose header files may be in
1908-
# the default SDK or, on older systems, actually installed.
1908+
# not the one in the default SDK.
19091909
framework_dirs = [
19101910
join('/', 'Library', 'Frameworks'),
1911-
join(sysroot, 'System', 'Library', 'Frameworks'),
19121911
]
19131912

19141913
# Find the directory that contains the Tcl.framework and

0 commit comments

Comments
 (0)