diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2014-04-28 17:23:19 -0700 |
---|---|---|
committer | Thomas A Caswell <tcaswell@gmail.com> | 2015-09-29 15:12:41 -0400 |
commit | 750060dc0211cfb5786ba39da7283e5885eac7ad (patch) | |
tree | 28337e94a44554ecf2c8263a8068e303f814b0dc /giscanner/sourcescanner.py | |
parent | 06166e54cea2302bf9213f18881495eb2b5d089d (diff) | |
download | gobject-introspection-750060dc0211cfb5786ba39da7283e5885eac7ad.tar.gz |
giscanner: Replace repr format usage with string formatter
Replace occurances of "%r" (repr) in format strings where the intended
behaviour is to output a quoted string "'foo'" with explicit usage
of "'%s'". This is needed to move the codebase to unicode literals
in order to upgrade to Python 3. Python 2 unicode strings are expanded
with repr formatting prefixed with a "u" as in "u'foo'" which causes
failures for various text formatting scenarios.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r-- | giscanner/sourcescanner.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py index b6f2dc4d..5de24ff7 100644 --- a/giscanner/sourcescanner.py +++ b/giscanner/sourcescanner.py @@ -124,7 +124,7 @@ class SourceType(object): self._stype = stype def __repr__(self): - return '<%s type=%r name=%r>' % ( + return "<%s type='%s' name='%s'>" % ( self.__class__.__name__, ctype_name(self.type), self.name) @@ -171,8 +171,8 @@ class SourceSymbol(object): if src: line = self.line if line: - src += ':%r' % (line, ) - return '<%s type=%r ident=%r src=%r>' % ( + src += ":'%s'" % (line, ) + return "<%s type='%s' ident='%s' src='%s'>" % ( self.__class__.__name__, symbol_type_name(self.type), self.ident, |