mirror of
https://github.com/python/cpython.git
synced 2025-11-13 23:46:24 +00:00
Fix webbrowser.BackgroundBrowser on Windows.
This commit is contained in:
parent
e042601251
commit
2c94bf7d41
2 changed files with 14 additions and 5 deletions
|
|
@ -165,6 +165,9 @@ class GenericBrowser(BaseBrowser):
|
||||||
cmdline = [self.name] + [arg.replace("%s", url)
|
cmdline = [self.name] + [arg.replace("%s", url)
|
||||||
for arg in self.args]
|
for arg in self.args]
|
||||||
try:
|
try:
|
||||||
|
if sys.platform[:3] == 'win':
|
||||||
|
p = subprocess.Popen(cmdline)
|
||||||
|
else:
|
||||||
p = subprocess.Popen(cmdline, close_fds=True)
|
p = subprocess.Popen(cmdline, close_fds=True)
|
||||||
return not p.wait()
|
return not p.wait()
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
@ -178,10 +181,13 @@ class BackgroundBrowser(GenericBrowser):
|
||||||
def open(self, url, new=0, autoraise=1):
|
def open(self, url, new=0, autoraise=1):
|
||||||
cmdline = [self.name] + [arg.replace("%s", url)
|
cmdline = [self.name] + [arg.replace("%s", url)
|
||||||
for arg in self.args]
|
for arg in self.args]
|
||||||
|
try:
|
||||||
|
if sys.platform[:3] == 'win':
|
||||||
|
p = subprocess.Popen(cmdline)
|
||||||
|
else:
|
||||||
setsid = getattr(os, 'setsid', None)
|
setsid = getattr(os, 'setsid', None)
|
||||||
if not setsid:
|
if not setsid:
|
||||||
setsid = getattr(os, 'setpgrp', None)
|
setsid = getattr(os, 'setpgrp', None)
|
||||||
try:
|
|
||||||
p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
|
p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
|
||||||
return (p.poll() is None)
|
return (p.poll() is None)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@ Core and builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Make webbrowser.BackgroundBrowser usable in Windows (it wasn't because
|
||||||
|
the close_fds arg to subprocess.Popen is not supported).
|
||||||
|
|
||||||
- Reverted patch #1504333 to sgmllib because it introduced an infinite loop.
|
- Reverted patch #1504333 to sgmllib because it introduced an infinite loop.
|
||||||
|
|
||||||
- Patch #1553314: Fix the inspect.py slowdown that was hurting IPython & SAGE
|
- Patch #1553314: Fix the inspect.py slowdown that was hurting IPython & SAGE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue