summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-04-28 23:24:36 -0700
committerColin Walters <walters@verbum.org>2015-09-29 23:16:32 -0400
commitecbf1460ffe0f1f6fa42fe79b27c22969d194cf5 (patch)
tree8f19ddfa2d10fb1e8eeea679f1541a25f0f0e7d3 /giscanner
parent0211bda3da384818c0f99b5a468022c7529fed7e (diff)
downloadgobject-introspection-ecbf1460ffe0f1f6fa42fe79b27c22969d194cf5.tar.gz
giscanner: Decode command output for Python 3 compatibility
Decode the output of various subprocess calls assuming ascii encoding. https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/dumper.py3
-rwxr-xr-xgiscanner/scannermain.py1
-rw-r--r--giscanner/shlibs.py1
3 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
index 0a59e773..5bc48ada 100644
--- a/giscanner/dumper.py
+++ b/giscanner/dumper.py
@@ -196,7 +196,8 @@ class DumpCompiler(object):
proc = subprocess.Popen(
cmd + self._packages,
stdout=subprocess.PIPE)
- return proc.communicate()[0].split()
+ out, err = proc.communicate()
+ return out.decode('ascii').split()
def _compile(self, *sources):
pkgconfig_flags = self._run_pkgconfig('--cflags')
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index b1b0ff6c..628528f8 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -298,6 +298,7 @@ def process_packages(options, packages):
# the error output should have already appeared on our stderr,
# so we just exit
return 1
+ output = output.decode('ascii')
# Some pkg-config files on Windows have options we don't understand,
# so we explicitly filter to only the ones we need.
options_whitelist = ['-I', '-D', '-U', '-l', '-L']
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
index c1f89bed..c93d20cf 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -116,6 +116,7 @@ def _resolve_non_libtool(options, binary, libraries):
shlibs = []
for line in proc.stdout:
+ line = line.decode('ascii')
for library, pattern in patterns.items():
m = pattern.search(line)
if m: