summaryrefslogtreecommitdiff
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorTerry Reedy <tjreedy@udel.edu>2011-01-01 02:32:46 +0000
committerTerry Reedy <tjreedy@udel.edu>2011-01-01 02:32:46 +0000
commit247327a27e622a344787464fea404dd73bc71c50 (patch)
tree1690f8340172d89354dc72abd9df244faebb7f00 /Lib/idlelib/EditorWindow.py
parentc0b3544268e962d811c890645fb74118a3143be2 (diff)
downloadcpython-git-247327a27e622a344787464fea404dd73bc71c50.tar.gz
Issue 6285: catch missing IDLE help file. Backport from 3.2.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index c6a4001b22..9e7573d644 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -452,7 +452,11 @@ class EditorWindow(object):
def python_docs(self, event=None):
if sys.platform[:3] == 'win':
- os.startfile(self.help_url)
+ try:
+ os.startfile(self.help_url)
+ except WindowsError as why:
+ tkMessageBox.showerror(title='Document Start Failure',
+ message=str(why), parent=self.text)
else:
webbrowser.open(self.help_url)
return "break"
@@ -747,9 +751,13 @@ class EditorWindow(object):
"Create a callback with the helpfile value frozen at definition time"
def display_extra_help(helpfile=helpfile):
if not helpfile.startswith(('www', 'http')):
- url = os.path.normpath(helpfile)
+ helpfile = os.path.normpath(helpfile)
if sys.platform[:3] == 'win':
- os.startfile(helpfile)
+ try:
+ os.startfile(helpfile)
+ except WindowsError as why:
+ tkMessageBox.showerror(title='Document Start Failure',
+ message=str(why), parent=self.text)
else:
webbrowser.open(helpfile)
return display_extra_help