Skip to content

Commit

Permalink
gh-103300: Fix Popen.wait() deadlock in patchcheck.py (#103301)
Browse files Browse the repository at this point in the history
  • Loading branch information
arhadthedev authored Apr 9, 2023
1 parent d9305f8 commit 86d2044
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tools/patchcheck/patchcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 86d2044

Please sign in to comment.