From 48dc0cbf2a97dde2d34f3785f4582e2a54295d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Ha=C5=82as?= Date: Sat, 23 Feb 2013 18:54:54 +0100 Subject: [PATCH] Changed %r to %s in get_language_info error message. --- django/utils/translation/__init__.py | 4 ++-- tests/regressiontests/i18n/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py index 4645f142ce..292e4db869 100644 --- a/django/utils/translation/__init__.py +++ b/django/utils/translation/__init__.py @@ -192,5 +192,5 @@ def get_language_info(lang_code): try: return LANG_INFO[splited_lang_code] except KeyError: - raise KeyError("Unknown language code %r and %r." % (lang_code, splited_lang_code)) - raise KeyError("Unknown language code %r." % lang_code) + raise KeyError("Unknown language code %s and %s." % (lang_code, splited_lang_code)) + raise KeyError("Unknown language code %s." % lang_code) diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 9e79f35d74..5e4726b67a 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -957,7 +957,7 @@ class TestLanguageInfo(TestCase): self.assertEqual(li['bidi'], False) def test_unknown_language_code(self): - with self.assertRaisesRegexp(KeyError, "Unknown language code u\'xx\'."): + with self.assertRaisesRegexp(KeyError, "Unknown language code xx."): get_language_info('xx') def test_unknown_only_country_code(self): @@ -968,7 +968,7 @@ class TestLanguageInfo(TestCase): self.assertEqual(li['bidi'], False) def test_unknown_language_code_and_country_code(self): - with self.assertRaisesRegexp(KeyError, "Unknown language code u\'xx-xx\' and u\'xx\'."): + with self.assertRaisesRegexp(KeyError, "Unknown language code xx-xx and xx."): get_language_info('xx-xx')