Closes #15499: Sleep is hardcoded in webbrowser.UnixBrowser

This commit is contained in:
Jesus Cea 2012-08-01 03:57:52 +02:00
parent 0efcf99c9e
commit c9aa321a01
2 changed files with 10 additions and 10 deletions

View File

@ -232,17 +232,14 @@ class UnixBrowser(BaseBrowser):
stdout=(self.redirect_stdout and inout or None),
stderr=inout, start_new_session=True)
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.
time.sleep(1)
rc = p.poll()
if rc is None:
time.sleep(4)
rc = p.poll()
if rc is None:
return True
# if remote call failed, open() will try direct invocation
return not rc
try:
rc = p.wait(5)
# if remote call failed, open() will try direct invocation
return not rc
except subprocess.TimeoutExpired:
return True
elif self.background:
if p.poll() is None:
return True

View File

@ -72,6 +72,9 @@ Core and Builtins
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,
instead of 100, to be able to display long file paths