mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
Issue 6285: catch missing IDLE help file.
This commit is contained in:
parent
8dff4bada7
commit
6739cc0821
1 changed files with 11 additions and 3 deletions
|
@ -450,7 +450,11 @@ class EditorWindow(object):
|
||||||
|
|
||||||
def python_docs(self, event=None):
|
def python_docs(self, event=None):
|
||||||
if sys.platform[:3] == 'win':
|
if sys.platform[:3] == 'win':
|
||||||
|
try:
|
||||||
os.startfile(self.help_url)
|
os.startfile(self.help_url)
|
||||||
|
except WindowsError as why:
|
||||||
|
tkMessageBox.showerror(title='Document Start Failure',
|
||||||
|
message=str(why), parent=self.text)
|
||||||
else:
|
else:
|
||||||
webbrowser.open(self.help_url)
|
webbrowser.open(self.help_url)
|
||||||
return "break"
|
return "break"
|
||||||
|
@ -753,9 +757,13 @@ class EditorWindow(object):
|
||||||
"Create a callback with the helpfile value frozen at definition time"
|
"Create a callback with the helpfile value frozen at definition time"
|
||||||
def display_extra_help(helpfile=helpfile):
|
def display_extra_help(helpfile=helpfile):
|
||||||
if not helpfile.startswith(('www', 'http')):
|
if not helpfile.startswith(('www', 'http')):
|
||||||
url = os.path.normpath(helpfile)
|
helpfile = os.path.normpath(helpfile)
|
||||||
if sys.platform[:3] == 'win':
|
if sys.platform[:3] == 'win':
|
||||||
|
try:
|
||||||
os.startfile(helpfile)
|
os.startfile(helpfile)
|
||||||
|
except WindowsError as why:
|
||||||
|
tkMessageBox.showerror(title='Document Start Failure',
|
||||||
|
message=str(why), parent=self.text)
|
||||||
else:
|
else:
|
||||||
webbrowser.open(helpfile)
|
webbrowser.open(helpfile)
|
||||||
return display_extra_help
|
return display_extra_help
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue