Fix Python2 fallback in git-cl post-upload hooks

This fixes an uninitialized variable.

Bug: 1411979, 1435326
Change-Id: Ib28ed259238ff478e78e36b48e74eaf51617cd6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4457528
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
changes/28/4457528/2
Michael Achenbach 2 years ago committed by LUCI CQ
parent dec6fddc86
commit b5cec8c867

@ -1514,11 +1514,12 @@ class Changelist(object):
with gclient_utils.temporary_file() as description_file:
gclient_utils.FileWrite(description_file, description)
args.extend(['--description_file', description_file])
if not py3_only and os.getenv('LUCI_OMIT_PYTHON2') != 'true':
run_py2 = not py3_only and os.getenv('LUCI_OMIT_PYTHON2') != 'true'
if run_py2:
p_py2 = subprocess2.Popen(['vpython', PRESUBMIT_SUPPORT] + args)
p_py3 = subprocess2.Popen(['vpython3', PRESUBMIT_SUPPORT] + args +
['--use-python3'])
if not py3_only:
if run_py2:
p_py2.wait()
p_py3.wait()

Loading…
Cancel
Save