From ee28491dec8b34e60e5e8278c769929adeed05ed Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 28 Oct 2015 16:13:07 +0800 Subject: giscanner/ccompiler.py: Make Windows builds work with Python 3.x Windows builds check the library that was passed into the introspection scanner to deduce the correct DLL that is to be used by the .gir/.typelib file, but this was not updated for Python 2.x/3.x compatibility, as the outputs of a subprocess must be decoded. Fix this for both MSVC and MinGW-based builds. https://bugzilla.gnome.org/show_bug.cgi?id=757126 --- giscanner/ccompiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py index 515b4227..9b27f0e1 100644 --- a/giscanner/ccompiler.py +++ b/giscanner/ccompiler.py @@ -285,7 +285,7 @@ class CCompiler(object): proc = subprocess.Popen([self.compiler_cmd, '-print-search-dirs'], stdout=subprocess.PIPE) o, e = proc.communicate() - for line in o.splitlines(): + for line in o.decode('ascii').splitlines(): if line.startswith('libraries: '): libsearch = line[len('libraries: '):].split(';') @@ -313,7 +313,7 @@ class CCompiler(object): proc = subprocess.Popen(args + [implib], stdout=subprocess.PIPE) o, e = proc.communicate() - for line in o.splitlines(): + for line in o.decode('ascii').splitlines(): if self.check_is_msvc(): # On Visual Studio, dumpbin -symbols something.lib gives the # filename of DLL without the '.dll' extension that something.lib -- cgit v1.2.1