diff options
author | Oleg Iarygin <oleg@arhadthedev.net> | 2023-04-09 12:18:53 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-09 13:48:53 +0530 |
commit | 86d20441557bedbea3dadd5d0818a492148335bd (patch) | |
tree | ec7136d645f01c36ba5003a95f1f78a1c0d40813 /Tools | |
parent | d9305f8e9d3e0f6267286c2da4b24e97b7a569f2 (diff) | |
download | cpython-git-86d20441557bedbea3dadd5d0818a492148335bd.tar.gz |
gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301)
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/patchcheck/patchcheck.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/patchcheck/patchcheck.py b/Tools/patchcheck/patchcheck.py index 6dcf612066..44a6fb8c66 100755 --- a/Tools/patchcheck/patchcheck.py +++ b/Tools/patchcheck/patchcheck.py @@ -130,9 +130,10 @@ def changed_files(base_branch=None): with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, cwd=SRCDIR) as st: - if st.wait() != 0: + git_file_status, _ = st.communicate() + if st.returncode != 0: sys.exit(f'error running {cmd}') - for line in st.stdout: + for line in git_file_status.splitlines(): line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1) status = set(status_text) |