]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue 6285: catch missing IDLE help file.
authorTerry Reedy <tjreedy@udel.edu>
Sat, 1 Jan 2011 02:28:54 +0000 (02:28 +0000)
committerTerry Reedy <tjreedy@udel.edu>
Sat, 1 Jan 2011 02:28:54 +0000 (02:28 +0000)
Lib/idlelib/EditorWindow.py

index 2cbf9c339bd52657b4ed143df5045f7fb346af75..20a2b26bafc4049b2e816e380efdcab8abab9f82 100644 (file)
@@ -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