summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2015-10-28 16:28:43 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2015-10-28 22:05:19 +0800
commitcb1fabbd3641cfebf7d493d6eca73eab3d2027a2 (patch)
treea8a982f05c4d04974e18ebe3721235b6626ac175
parent3bb86dedb9c2fc6352d240ea03532133b75b5f58 (diff)
downloadgobject-introspection-cb1fabbd3641cfebf7d493d6eca73eab3d2027a2.tar.gz
giscanner/transformer.py: Fix --identifier-filter on Python 3.x
We need to encode the identifier-filter command to bytes, and decode its outputs to ascii in order for it to work on Python 3.x. https://bugzilla.gnome.org/show_bug.cgi?id=757126
-rw-r--r--giscanner/transformer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 3183d622..e8b1e049 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -326,10 +326,11 @@ raise ValueError."""
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
- ident, err = proc.communicate(ident)
+ proc_ident, err = proc.communicate(ident.encode())
if proc.returncode:
raise ValueError('filter: "%s" exited: %d with error: %s' %
(self._identifier_filter_cmd, proc.returncode, err))
+ ident = proc_ident.decode('ascii')
hidden = ident.startswith('_')
if hidden: