diff options
author | Oleg Iarygin <oleg@arhadthedev.net> | 2023-04-09 08:18:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-09 08:18:53 (GMT) |
commit | 86d20441557bedbea3dadd5d0818a492148335bd (patch) | |
tree | ec7136d645f01c36ba5003a95f1f78a1c0d40813 | |
parent | d9305f8e9d3e0f6267286c2da4b24e97b7a569f2 (diff) | |
download | cpython-86d20441557bedbea3dadd5d0818a492148335bd.zip cpython-86d20441557bedbea3dadd5d0818a492148335bd.tar.gz cpython-86d20441557bedbea3dadd5d0818a492148335bd.tar.bz2 |
gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301)
-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 6dcf612..44a6fb8 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) |