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/ast.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/ast.py')
-rw-r--r-- | giscanner/ast.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index fe1a2e57..db1f07be 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -564,7 +564,7 @@ GIName. It's possible for nodes to contain or point to other nodes.""" return cmp(self.name, other.name) def __repr__(self): - return '%s(%r)' % (self.__class__.__name__, self.name) + return "%s('%s')" % (self.__class__.__name__, self.name) def inherit_file_positions(self, node): self.file_positions.update(node.file_positions) @@ -861,7 +861,7 @@ class Member(Annotated): return cmp(self.name, other.name) def __repr__(self): - return '%s(%r)' % (self.__class__.__name__, self.name) + return "%s('%s')" % (self.__class__.__name__, self.name) class Compound(Node, Registered): @@ -934,7 +934,7 @@ class Field(Annotated): return cmp(self.name, other.name) def __repr__(self): - return '%s(%r)' % (self.__class__.__name__, self.name) + return "%s('%s')" % (self.__class__.__name__, self.name) class Record(Compound): |