From: Terry Reedy Date: Sat, 1 Jan 2011 02:25:36 +0000 (+0000) Subject: Issue 6285: catch missing IDLE help file. X-Git-Tag: v3.2rc1~264 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6739cc0821dcbec0af6d8ed5d652d35af0632332;p=python Issue 6285: catch missing IDLE help file. --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index b89214cffb..7b7eb3939d 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