Commit c9aa321a authored by Jesus Cea's avatar Jesus Cea

Closes #15499: Sleep is hardcoded in webbrowser.UnixBrowser

parent 0efcf99c
...@@ -232,17 +232,14 @@ class UnixBrowser(BaseBrowser): ...@@ -232,17 +232,14 @@ class UnixBrowser(BaseBrowser):
stdout=(self.redirect_stdout and inout or None), stdout=(self.redirect_stdout and inout or None),
stderr=inout, start_new_session=True) stderr=inout, start_new_session=True)
if remote: if remote:
# wait five seconds. If the subprocess is not finished, the # wait at most five seconds. If the subprocess is not finished, the
# remote invocation has (hopefully) started a new instance. # remote invocation has (hopefully) started a new instance.
time.sleep(1) try:
rc = p.poll() rc = p.wait(5)
if rc is None: # if remote call failed, open() will try direct invocation
time.sleep(4) return not rc
rc = p.poll() except subprocess.TimeoutExpired:
if rc is None: return True
return True
# if remote call failed, open() will try direct invocation
return not rc
elif self.background: elif self.background:
if p.poll() is None: if p.poll() is None:
return True return True
......
...@@ -72,6 +72,9 @@ Core and Builtins ...@@ -72,6 +72,9 @@ Core and Builtins
Library Library
------- -------
- Issue #15499: Launching a webbrowser in Unix used to sleep for a few
seconds. Original patch by Anton Barkovsky.
- Issue #15463: the faulthandler module truncates strings to 500 characters, - Issue #15463: the faulthandler module truncates strings to 500 characters,
instead of 100, to be able to display long file paths instead of 100, to be able to display long file paths
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment