From d64e1cc1d43c173a27bbd77b07f695c41f8c4b55 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 1 Dec 2015 23:00:53 -0800 Subject: transformer: Strip whitespace from filter commands On OS X, the output of sed as reported back to Python has a newline at the end. It seems like a good idea to strip whitespace from the symbol and identifier filter commands anyhow, so strip() the result. See #139. --- giscanner/transformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 81b4d0ae..50018cd2 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -267,6 +267,7 @@ currently-scanned namespace is first.""" raise ValueError('filter: "%s" exited: %d with error: %s' % (self._symbol_filter_cmd, proc.returncode, err)) name = proc_name.decode('ascii') + name = name.strip() matches = [] # Namespaces which might contain this name unprefixed_namespaces = [] # Namespaces with no prefix, last resort @@ -331,7 +332,7 @@ raise ValueError.""" if proc.returncode: raise ValueError('filter: "%s" exited: %d with error: %s' % (self._identifier_filter_cmd, proc.returncode, err)) - ident = proc_ident.decode('ascii') + ident = proc_ident.decode('ascii').strip() hidden = ident.startswith('_') if hidden: -- cgit v1.2.1