mirror of
https://github.com/python/cpython.git
synced 2025-10-26 11:14:33 +00:00
parent
a045f191b4
commit
94f25283c9
20 changed files with 52 additions and 196 deletions
|
|
@ -2024,7 +2024,7 @@ def log_message(self, *args): pass
|
|||
|
||||
class DocServer(http.server.HTTPServer):
|
||||
def __init__(self, port, callback):
|
||||
host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
|
||||
host = 'localhost'
|
||||
self.address = ('', port)
|
||||
self.url = 'http://%s:%d/' % (host, port)
|
||||
self.callback = callback
|
||||
|
|
@ -2141,10 +2141,6 @@ def open(self, event=None, url=None):
|
|||
except ImportError: # pre-webbrowser.py compatibility
|
||||
if sys.platform == 'win32':
|
||||
os.system('start "%s"' % url)
|
||||
elif sys.platform == 'mac':
|
||||
try: import ic
|
||||
except ImportError: pass
|
||||
else: ic.launchurl(url)
|
||||
else:
|
||||
rc = os.system('netscape -remote "openURL(%s)" &' % url)
|
||||
if rc: os.system('netscape "%s" &' % url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue