chore: make apply_all_patches.py work in both python2 and python3 (#19872)

This commit is contained in:
Charles Kerr 2019-08-23 17:48:27 -05:00 committed by Samuel Attard
parent 81e9dab52f
commit ef6d4a46c2
3 changed files with 4 additions and 3 deletions

View file

@ -61,7 +61,7 @@ def am(repo, patch_data, threeway=False, directory=None, exclude=None,
proc = subprocess.Popen(
command,
stdin=subprocess.PIPE)
proc.communicate(patch_data)
proc.communicate(patch_data.encode('utf-8'))
if proc.returncode != 0:
raise RuntimeError("Command {} returned {}".format(command,
proc.returncode))