From d0c83aaca4403c1c7deb8025d9dc2d2728f349b1 Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Thu, 16 Aug 2018 19:38:39 -0700 Subject: [PATCH] Fix issues with backend native --- src/python/pants/backend/native/targets/native_artifact.py | 3 ++- .../backend/native/subsystems/test_native_toolchain.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/pants/backend/native/targets/native_artifact.py b/src/python/pants/backend/native/targets/native_artifact.py index f2024d7f5c8..54f10a8028c 100644 --- a/src/python/pants/backend/native/targets/native_artifact.py +++ b/src/python/pants/backend/native/targets/native_artifact.py @@ -29,4 +29,5 @@ def as_shared_lib(self, platform): def _compute_fingerprint(self): # FIXME: can we just use the __hash__ method here somehow? - return sha1(self.lib_name).hexdigest() if PY3 else sha1(self.lib_name).hexdigest().decode('utf-8') + hasher = sha1(self.lib_name.encode('utf-8')) + return hasher.hexdigest() if PY3 else hasher.hexdigest().decode('utf-8') diff --git a/tests/python/pants_test/backend/native/subsystems/test_native_toolchain.py b/tests/python/pants_test/backend/native/subsystems/test_native_toolchain.py index 0c256e1cff2..e7e9fe571c5 100644 --- a/tests/python/pants_test/backend/native/subsystems/test_native_toolchain.py +++ b/tests/python/pants_test/backend/native/subsystems/test_native_toolchain.py @@ -134,7 +134,7 @@ def _invoke_capturing_output(self, cmd, env=None): env = os.environ.copy() try: with environment_as(**env): - return subprocess.check_output(cmd, stderr=subprocess.STDOUT) + return subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode('utf-8') except subprocess.CalledProcessError as e: raise Exception( "Command failed while invoking the native toolchain "