From 750060dc0211cfb5786ba39da7283e5885eac7ad Mon Sep 17 00:00:00 2001 From: Simon Feltman Date: Mon, 28 Apr 2014 17:23:19 -0700 Subject: 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 --- tests/warn/warningtester.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/warn') 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:])) -- cgit v1.2.1