pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/abc3aeebdbae560476f2f8c0312e9a4bf0dbfd33

241e157469407.css" /> gh-121605: Increase timeout in test_pyrepl.run_repl (#121606) · python/cpython@abc3aee · GitHub
Skip to content

Commit abc3aee

Browse files
authored
gh-121605: Increase timeout in test_pyrepl.run_repl (#121606)
We also need to close the `slave_fd` earlier so that reading from `master_fd` won't block forever when the subprocess finishes.
1 parent 0a26aa5 commit abc3aee

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -981,20 +981,23 @@ def run_repl(self, repl_input: str | list[str], env: dict | None = None) -> tupl
981981
text=True,
982982
close_fds=True,
983983
env=env if env else os.environ,
984-
)
984+
)
985+
os.close(slave_fd)
985986
if isinstance(repl_input, list):
986987
repl_input = "\n".join(repl_input) + "\n"
987988
os.write(master_fd, repl_input.encode("utf-8"))
988989

989990
output = []
990-
while select.select([master_fd], [], [], 0.5)[0]:
991-
data = os.read(master_fd, 1024).decode("utf-8")
992-
if not data:
991+
while select.select([master_fd], [], [], SHORT_TIMEOUT)[0]:
992+
try:
993+
data = os.read(master_fd, 1024).decode("utf-8")
994+
if not data:
995+
break
996+
except OSError:
993997
break
994998
output.append(data)
995999

9961000
os.close(master_fd)
997-
os.close(slave_fd)
9981001
try:
9991002
exit_code = process.wait(timeout=SHORT_TIMEOUT)
10001003
except subprocess.TimeoutExpired:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy