diff options
author | Terry Reedy <tjreedy@udel.edu> | 2011-01-01 02:25:36 (GMT) |
---|---|---|
committer | Terry Reedy <tjreedy@udel.edu> | 2011-01-01 02:25:36 (GMT) |
commit | 6739cc0821dcbec0af6d8ed5d652d35af0632332 (patch) | |
tree | be27276c0b052a56f825194a5590da512fc89e8f /Lib | |
parent | 8dff4bada79d3662f8c799ea4572d51a2f8eed0a (diff) | |
download | cpython-6739cc0821dcbec0af6d8ed5d652d35af0632332.zip cpython-6739cc0821dcbec0af6d8ed5d652d35af0632332.tar.gz cpython-6739cc0821dcbec0af6d8ed5d652d35af0632332.tar.bz2 |
Issue 6285: catch missing IDLE help file.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index b89214c..7b7eb39 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -450,7 +450,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" @@ -753,9 +757,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 |