summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.com>2019-09-22 07:19:18 +0200
committerSF initial configurator <admin@softwarefactory-project.io>2019-12-17 15:44:14 +0000
commite1f915262f36efa0d4be741f60903028253b531d (patch)
tree0edb51067226836bdc90880789eb89c718e4760f
parente9c0c35c95b0dfce367a7031439e5d60791c60da (diff)
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
-rw-r--r--roles/tox/library/tox_install_sibling_packages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/tox/library/tox_install_sibling_packages.py b/roles/tox/library/tox_install_sibling_packages.py
index d2a0410..abec207 100644
--- a/roles/tox/library/tox_install_sibling_packages.py
+++ b/roles/tox/library/tox_install_sibling_packages.py
@@ -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>)'