[Python-checkins] r87599 - python/branches/release31-maint/Lib/idlelib/EditorWindow.py
terry.reedy
python-checkins at python.org
Sat Jan 1 03:28:54 CET 2011
Author: terry.reedy
Date: Sat Jan 1 03:28:54 2011
New Revision: 87599
Log:
Issue 6285: catch missing IDLE help file.
Modified:
python/branches/release31-maint/Lib/idlelib/EditorWindow.py
Modified: python/branches/release31-maint/Lib/idlelib/EditorWindow.py
==============================================================================
--- python/branches/release31-maint/Lib/idlelib/EditorWindow.py (original)
+++ python/branches/release31-maint/Lib/idlelib/EditorWindow.py Sat Jan 1 03:28:54 2011
@@ -451,7 +451,11 @@
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 @@
"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
More information about the Python-checkins
mailing list