8000 gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301) · python/cpython@86d2044 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86d2044

Browse files
authored
gh-103300: Fix Popen.wait() deadlock in patchcheck.py (#103301)
1 parent d9305f8 commit 86d2044

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tools/patchcheck/patchcheck.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ def changed_files(base_branch=None):
130130
with subprocess.Popen(cmd.split(),
131131
stdout=subprocess.PIPE,
132132
cwd=SRCDIR) as st:
133-
if st.wait() != 0:
133+
git_file_status, _ = st.communicate()
134+
if st.returncode != 0:
134135
sys.exit(f'error running {cmd}')
135-
for line in st.stdout:
136+
for line in git_file_status.splitlines():
136137
line = line.decode().rstrip()
137138
status_text, filename = line.split(maxsplit=1)
138139
status = set(status_text)

0 commit comments

Comments
 (0)
0