Commit 2b9bec7f authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Remove uses of `six` from test_env.py.

https://crrev.com/c/2229335 added a dependency on `six` from
test_env.py in order to try and make it compatible with both
Python 2 and Python 3. However, it got the path to the
//third_party version of six wrong, and so it actually only worked
if six was available otherwise in the Python install (which it is,
most of the time, these days).

The script didn't actually benefit much from six, though, so
rather than fix the import path, this CL just makes the code
2- and 3-compatible without needing six, and removes the dependency
instead.

Bug: 942720
Change-Id: I44e44772cea8d92eff10a5c59879ce4d05de8fcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545924
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828587}
parent 20fec9af
......@@ -13,15 +13,6 @@ import subprocess
import sys
import time
SIX_DIR = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'third_party',
'six')
sys.path.insert(0, SIX_DIR)
try:
import six
except ImportError:
raise Exception('Failed to import six. Run under vpython or install six.')
# This is hardcoded to be src/ relative to this script.
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -354,8 +345,8 @@ def run_executable(cmd, env, stdoutfile=None):
print('Additional test environment:\n%s\n'
'Command: %s\n' % (
'\n'.join(' %s=%s' %
(k, v) for k, v in sorted(six.iteritems(env_to_print))),
'\n'.join(' %s=%s' % (k, v)
for k, v in sorted(env_to_print.items())),
' '.join(cmd)))
sys.stdout.flush()
env.update(extra_env or {})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment