From: Oleg Iarygin Date: Sun, 9 Apr 2023 08:18:53 +0000 (+0400) Subject: gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301) X-Git-Tag: v3.12.0b1~593 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86d20441557bedbea3dadd5d0818a492148335bd;p=thirdparty%2FPython%2Fcpython.git gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301) --- diff --git a/Tools/patchcheck/patchcheck.py b/Tools/patchcheck/patchcheck.py index 6dcf61206619..44a6fb8c660c 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)