mirror of https://github.com/python/cpython
bpo-46996: IDLE: Drop workarounds for old Tk versions (GH-31962)
This commit is contained in:
parent
92a6abf72e
commit
383a3bec74
|
@ -1588,7 +1588,7 @@ class WinPage(Frame):
|
||||||
win_height_int: Entry > win_height
|
win_height_int: Entry > win_height
|
||||||
frame_cursor: Frame
|
frame_cursor: Frame
|
||||||
indent_title: Label
|
indent_title: Label
|
||||||
indent_chooser: Spinbox (Combobox < 8.5.9) > indent_spaces
|
indent_chooser: Spinbox > indent_spaces
|
||||||
blink_on: Checkbutton > cursor_blink
|
blink_on: Checkbutton > cursor_blink
|
||||||
frame_autocomplete: Frame
|
frame_autocomplete: Frame
|
||||||
auto_wait_title: Label
|
auto_wait_title: Label
|
||||||
|
|
|
@ -68,27 +68,6 @@ def isXQuartz():
|
||||||
return _tk_type == "xquartz"
|
return _tk_type == "xquartz"
|
||||||
|
|
||||||
|
|
||||||
def tkVersionWarning(root):
|
|
||||||
"""
|
|
||||||
Returns a string warning message if the Tk version in use appears to
|
|
||||||
be one known to cause problems with IDLE.
|
|
||||||
1. Apple Cocoa-based Tk 8.5.7 shipped with Mac OS X 10.6 is unusable.
|
|
||||||
2. Apple Cocoa-based Tk 8.5.9 in OS X 10.7 and 10.8 is better but
|
|
||||||
can still crash unexpectedly.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if isCocoaTk():
|
|
||||||
patchlevel = root.tk.call('info', 'patchlevel')
|
|
||||||
if patchlevel not in ('8.5.7', '8.5.9'):
|
|
||||||
return False
|
|
||||||
return ("WARNING: The version of Tcl/Tk ({0}) in use may"
|
|
||||||
" be unstable.\n"
|
|
||||||
"Visit https://www.python.org/download/mac/tcltk/"
|
|
||||||
" for current information.".format(patchlevel))
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def readSystemPreferences():
|
def readSystemPreferences():
|
||||||
"""
|
"""
|
||||||
Fetch the macOS system preferences.
|
Fetch the macOS system preferences.
|
||||||
|
|
|
@ -22,15 +22,6 @@ if sys.platform == 'win32':
|
||||||
pass
|
pass
|
||||||
|
|
||||||
from tkinter import messagebox
|
from tkinter import messagebox
|
||||||
if TkVersion < 8.5:
|
|
||||||
root = Tk() # otherwise create root in main
|
|
||||||
root.withdraw()
|
|
||||||
from idlelib.run import fix_scaling
|
|
||||||
fix_scaling(root)
|
|
||||||
messagebox.showerror("Idle Cannot Start",
|
|
||||||
"Idle requires tcl/tk 8.5+, not %s." % TkVersion,
|
|
||||||
parent=root)
|
|
||||||
raise SystemExit(1)
|
|
||||||
|
|
||||||
from code import InteractiveInterpreter
|
from code import InteractiveInterpreter
|
||||||
import itertools
|
import itertools
|
||||||
|
@ -1690,11 +1681,6 @@ def main():
|
||||||
# the IDLE shell window; this is less intrusive than always
|
# the IDLE shell window; this is less intrusive than always
|
||||||
# opening a separate window.
|
# opening a separate window.
|
||||||
|
|
||||||
# Warn if using a problematic OS X Tk version.
|
|
||||||
tkversionwarning = macosx.tkVersionWarning(root)
|
|
||||||
if tkversionwarning:
|
|
||||||
shell.show_warning(tkversionwarning)
|
|
||||||
|
|
||||||
# Warn if the "Prefer tabs when opening documents" system
|
# Warn if the "Prefer tabs when opening documents" system
|
||||||
# preference is set to "Always".
|
# preference is set to "Always".
|
||||||
prefer_tabs_preference_warning = macosx.preferTabsPreferenceWarning()
|
prefer_tabs_preference_warning = macosx.preferTabsPreferenceWarning()
|
||||||
|
|
Loading…
Reference in New Issue