From 29a65c1373b0f85d9caa627e182afc43e39f8393 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Sat, 28 Jun 2014 22:03:40 +0100 Subject: [PATCH] FIX: fix error for setup.py for Python 3 The subprocess command in Python 3 returns a bytes object. If the homebrew subprocess check returns a not-empty result, then setup crashes trying to combine the bytes with the string constants with and error like "TypeError: Can't mix strings and bytes in path components." --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e0a22f75f..1e634bc12 100644 --- a/setup.py +++ b/setup.py @@ -210,7 +210,9 @@ class pil_build_ext(build_ext): # if Homebrew is installed, use its lib and include directories import subprocess try: - prefix = subprocess.check_output(['brew', '--prefix']).strip() + prefix = subprocess.check_output( + ['brew', '--prefix'] + ).strip().decode('latin1') except: # Homebrew not installed prefix = None