diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2007-07-09 05:46:04 +0000 |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2007-07-09 05:46:04 +0000 |
commit | 43f1f68b7cfdea82c5eb76d017f26f5a93931cd5 (patch) | |
tree | 86d9681ec1461252a4be43f802e08c8f55e69af8 /Lib/idlelib/macosxSupport.py | |
parent | a1d47f0e89ac7156f315046d3fc9315a4013f150 (diff) | |
download | cpython-git-43f1f68b7cfdea82c5eb76d017f26f5a93931cd5.tar.gz |
Fixes IDLE crash on OSX: some versions of Tcl/Tk on OSX don't have a
console object, avoid crashing in that case.
Diffstat (limited to 'Lib/idlelib/macosxSupport.py')
-rw-r--r-- | Lib/idlelib/macosxSupport.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py index ad61fff46f..47da0c6023 100644 --- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosxSupport.py @@ -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). """ import sys +import Tkinter def runningAsOSXApp(): """ Returns True iff running from the IDLE.app bundle on OSX """ @@ -23,7 +24,11 @@ def addOpenEventSupport(root, flist): 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): """ |