Commit 43f1f68b authored by Ronald Oussoren's avatar Ronald Oussoren

Fixes IDLE crash on OSX: some versions of Tcl/Tk on OSX don't have a

console object, avoid crashing in that case.
parent a1d47f0e
...@@ -3,6 +3,7 @@ A number of function that enhance IDLE on MacOSX when it used as a normal ...@@ -3,6 +3,7 @@ A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application). GUI application (as opposed to an X11 application).
""" """
import sys import sys
import Tkinter
def runningAsOSXApp(): def runningAsOSXApp():
""" Returns True iff running from the IDLE.app bundle on OSX """ """ Returns True iff running from the IDLE.app bundle on OSX """
...@@ -23,7 +24,11 @@ def addOpenEventSupport(root, flist): ...@@ -23,7 +24,11 @@ def addOpenEventSupport(root, flist):
root.createcommand("::tk::mac::OpenDocument", doOpenFile) root.createcommand("::tk::mac::OpenDocument", doOpenFile)
def hideTkConsole(root): 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): def overrideRootMenu(root, flist):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment