mirror of
https://github.com/python/cpython.git
synced 2025-12-11 19:40:17 +00:00
gh-103300: Fix Popen.wait() deadlock in patchcheck.py (#103301)
This commit is contained in:
parent
d9305f8e9d
commit
86d2044155
1 changed files with 3 additions and 2 deletions
|
|
@ -130,9 +130,10 @@ def changed_files(base_branch=None):
|
||||||
with subprocess.Popen(cmd.split(),
|
with subprocess.Popen(cmd.split(),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
cwd=SRCDIR) as st:
|
cwd=SRCDIR) as st:
|
||||||
if st.wait() != 0:
|
git_file_status, _ = st.communicate()
|
||||||
|
if st.returncode != 0:
|
||||||
sys.exit(f'error running {cmd}')
|
sys.exit(f'error running {cmd}')
|
||||||
for line in st.stdout:
|
for line in git_file_status.splitlines():
|
||||||
line = line.decode().rstrip()
|
line = line.decode().rstrip()
|
||||||
status_text, filename = line.split(maxsplit=1)
|
status_text, filename = line.split(maxsplit=1)
|
||||||
status = set(status_text)
|
status = set(status_text)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue