summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Reedy <tjreedy@udel.edu>2011-01-01 02:28:54 (GMT)
committerTerry Reedy <tjreedy@udel.edu>2011-01-01 02:28:54 (GMT)
commit574a3cf08ae2767091dbbb805fa7ceee5d61840a (patch)
treede65470e714054650bd790d4d7426abc27991700 /Lib
parent2b8cf2f7541341afe2a7423d42284b1a9d87afdf (diff)
downloadcpython-574a3cf08ae2767091dbbb805fa7ceee5d61840a.zip
cpython-574a3cf08ae2767091dbbb805fa7ceee5d61840a.tar.gz
cpython-574a3cf08ae2767091dbbb805fa7ceee5d61840a.tar.bz2
Issue 6285: catch missing IDLE help file.
Diffstat (limited to 'Lib')
-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 2cbf9c3..20a2b26 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -451,7 +451,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"
@@ -754,9 +758,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