Support py3 in post upload presubmit hooks
Currently, post upload presubmit hooks are exlusively executed with py2,
regardless of USE_PYTHON3 magic variable. This change adds py3 support
in the same fasion as regular presubmit hooks.
R=aravindvasudev@google.com
Fixed: 1297712
Change-Id: Ib464f8563e4135a63fc48692d27c8692fe1f630b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3469285
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
diff --git a/git_cl.py b/git_cl.py
index 7222404..d59ea13 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1409,8 +1409,11 @@
with gclient_utils.temporary_file() as description_file:
gclient_utils.FileWrite(description_file, description)
args.extend(['--description_file', description_file])
- p = subprocess2.Popen(['vpython', PRESUBMIT_SUPPORT] + args)
- p.wait()
+ p_py2 = subprocess2.Popen(['vpython', PRESUBMIT_SUPPORT] + args)
+ p_py3 = subprocess2.Popen(['vpython3', PRESUBMIT_SUPPORT] + args +
+ ['--use-python3'])
+ p_py2.wait()
+ p_py3.wait()
def _GetDescriptionForUpload(self, options, git_diff_args, files):
# Get description message for upload.