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 /tests/warn/warningtester.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 'tests/warn/warningtester.py')
-rw-r--r-- | tests/warn/warningtester.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index e3d677a8..81d466fa 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -136,16 +136,16 @@ def check(args): emitted_warnings.sort(key=sortkey) if len(expected_warnings) != len(emitted_warnings): - raise SystemExit('ERROR in %r: %d warnings were emitted, ' - 'expected %d:\n%s' % (os.path.basename(filename), + raise SystemExit("ERROR in '%s': %d warnings were emitted, " + "expected %d:\n%s" % (os.path.basename(filename), len(emitted_warnings), len(expected_warnings), _diff(expected_warnings, emitted_warnings))) for emitted_warning, expected_warning in zip(emitted_warnings, expected_warnings): if expected_warning != emitted_warning: - raise SystemExit('ERROR in %r: expected warning does not match emitted ' - 'warning:\n%s' % (filename, + raise SystemExit("ERROR in '%s': expected warning does not match emitted " + "warning:\n%s" % (filename, _diff([expected_warning], [emitted_warning]))) sys.exit(check(sys.argv[1:])) |