[Python-checkins] r56203 - python/branches/release25-maint/Lib/idlelib/macosxSupport.py

ronald.oussoren python-checkins at python.org
Mon Jul 9 07:46:04 CEST 2007


Author: ronald.oussoren
Date: Mon Jul  9 07:46:04 2007
New Revision: 56203

Modified:
   python/branches/release25-maint/Lib/idlelib/macosxSupport.py
Log:
Fixes IDLE crash on OSX: some versions of Tcl/Tk on OSX don't have a
console object, avoid crashing in that case.


Modified: python/branches/release25-maint/Lib/idlelib/macosxSupport.py
==============================================================================
--- python/branches/release25-maint/Lib/idlelib/macosxSupport.py	(original)
+++ python/branches/release25-maint/Lib/idlelib/macosxSupport.py	Mon Jul  9 07:46:04 2007
@@ -3,6 +3,7 @@
 GUI application (as opposed to an X11 application).
 """
 import sys
+import Tkinter
 
 def runningAsOSXApp():
     """ Returns True iff running from the IDLE.app bundle on OSX """
@@ -23,7 +24,11 @@
     root.createcommand("::tk::mac::OpenDocument", doOpenFile)
 
 def hideTkConsole(root):
-    root.tk.call('console', 'hide')
+    try:
+        root.tk.call('console', 'hide')
+    except Tkinter.TclError:
+        # Some versions of the Tk framework don't have a console object
+        pass
 
 def overrideRootMenu(root, flist):
     """


More information about the Python-checkins mailing list