diff options
author | Ned Deily <nad@acm.org> | 2011-01-15 04:37:12 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2011-01-15 04:37:12 (GMT) |
commit | 4ce92b23fe968a6866f89e31f4bfd4585c0cead2 (patch) | |
tree | ebed0af100168b7caa6bafb9c93566b1478575ab /Lib | |
parent | c5982967fc25985699888e04a9a7e35ff7b7372a (diff) | |
download | cpython-4ce92b23fe968a6866f89e31f4bfd4585c0cead2.zip cpython-4ce92b23fe968a6866f89e31f4bfd4585c0cead2.tar.gz cpython-4ce92b23fe968a6866f89e31f4bfd4585c0cead2.tar.bz2 |
#10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5,
rather than the currently problematic Apple-supplied one,
when running with the 64-/32-bit installer variant.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/PyShell.py | 7 | ||||
-rw-r--r-- | Lib/idlelib/macosxSupport.py | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 429ba2e..06c8bba 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1417,6 +1417,13 @@ def main(): shell.interp.prepend_syspath(script) shell.interp.execfile(script) + # Check for problematic OS X Tk versions and print a warning message + # in the IDLE shell window; this is less intrusive than always opening + # a separate window. + tkversionwarning = macosxSupport.tkVersionWarning(root) + if tkversionwarning: + shell.interp.runcommand(''.join(("print('", tkversionwarning, "')"))) + root.mainloop() root.destroy() diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py index 4b365af..30dd1e1 100644 --- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosxSupport.py @@ -34,6 +34,23 @@ def isCarbonAquaTk(root): 'AppKit' not in root.tk.call('winfo', 'server', '.')) return _carbonaquatk +def tkVersionWarning(root): + """ + Returns a string warning message if the Tk version in use appears to + be one known to cause problems with IDLE. The Apple Cocoa-based Tk 8.5 + that was shipped with Mac OS X 10.6. + """ + + if (runningAsOSXApp() and + ('AppKit' in root.tk.call('winfo', 'server', '.')) and + (root.tk.call('info', 'patchlevel') == '8.5.7') ): + return (r"WARNING: The version of Tcl/Tk (8.5.7) in use may" + r" be unstable.\n" + r"Visit http://www.python.org/download/mac/tcltk/" + r" for current information.") + else: + return False + def addOpenEventSupport(root, flist): """ This ensures that the application will respont to open AppleEvents, which |