]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103300: Fix `Popen.wait()` deadlock in patchcheck.py (#103301)
authorOleg Iarygin <oleg@arhadthedev.net>
Sun, 9 Apr 2023 08:18:53 +0000 (12:18 +0400)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2023 08:18:53 +0000 (13:48 +0530)
Tools/patchcheck/patchcheck.py

index 6dcf612066199c685824288f2132c35b193fa9e6..44a6fb8c660cd29c44fa415f729ae9ac9c55ad28 100755 (executable)
@@ -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)