Fix tox_install_sibling_packages.py for py3
Under Python3, subprocess.check_output returns binary data, convert to utf-8 so that it runs under both Python2 and 3. Using decode works with both Py2 and Py3. Note that in other places, we already convert the output of check_output with decode, this change follows that pattern. Change-Id: I727a2368233473f57978ba24947f6d861b02f7da
This commit is contained in:
parent
e35c529bac
commit
4dbd165ef0
@ -95,7 +95,7 @@ def get_sibling_python_packages(projects, tox_python):
|
||||
# package name is.
|
||||
package_name = subprocess.check_output(
|
||||
[os.path.abspath(tox_python), 'setup.py', '--name'],
|
||||
cwd=os.path.abspath(root))
|
||||
cwd=os.path.abspath(root)).decode('utf-8')
|
||||
if package_name:
|
||||
package_name = package_name.strip()
|
||||
packages[package_name] = root
|
||||
@ -111,7 +111,7 @@ def get_installed_packages(tox_python):
|
||||
# interface.
|
||||
frozen_pkgs = subprocess.check_output(
|
||||
[tox_python, '-m', 'pip', '-qqq', 'freeze']
|
||||
)
|
||||
).decode('utf-8')
|
||||
# Matches strings of the form:
|
||||
# 1. '<package_name>==<version>'
|
||||
# 2. '# Editable Git install with no remote (<package_name>==<version>)'
|
||||
|
Loading…
x
Reference in New Issue
Block a user