diff options
author | Georg Brandl <georg@python.org> | 2006-09-24 10:36:01 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-09-24 10:36:01 (GMT) |
commit | 2c94bf7d410b151d6e7e38275c9dda871a5e8882 (patch) | |
tree | ceb95bfe89d2244797248bc9491327b8fa544d4f | |
parent | e042601251e74a1c5bac287c936daa076b1f9a80 (diff) | |
download | cpython-2c94bf7d410b151d6e7e38275c9dda871a5e8882.zip cpython-2c94bf7d410b151d6e7e38275c9dda871a5e8882.tar.gz cpython-2c94bf7d410b151d6e7e38275c9dda871a5e8882.tar.bz2 |
Fix webbrowser.BackgroundBrowser on Windows.
-rw-r--r-- | Lib/webbrowser.py | 16 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 7a1a3b4..7b0f736 100644 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -165,7 +165,10 @@ class GenericBrowser(BaseBrowser): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] try: - p = subprocess.Popen(cmdline, close_fds=True) + if sys.platform[:3] == 'win': + p = subprocess.Popen(cmdline) + else: + p = subprocess.Popen(cmdline, close_fds=True) return not p.wait() except OSError: return False @@ -178,11 +181,14 @@ class BackgroundBrowser(GenericBrowser): def open(self, url, new=0, autoraise=1): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] - setsid = getattr(os, 'setsid', None) - if not setsid: - setsid = getattr(os, 'setpgrp', None) try: - p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) + if sys.platform[:3] == 'win': + p = subprocess.Popen(cmdline) + else: + setsid = getattr(os, 'setsid', None) + if not setsid: + setsid = getattr(os, 'setpgrp', None) + p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) return (p.poll() is None) except OSError: return False @@ -52,6 +52,9 @@ Core and builtins 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. - Patch #1553314: Fix the inspect.py slowdown that was hurting IPython & SAGE |