diff options
author | Georg Brandl <georg@python.org> | 2010-10-20 06:50:19 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-20 06:50:19 (GMT) |
commit | 9450cc056a19d7d12a819fa020f4f1abf805d58c (patch) | |
tree | ca8469293b114aa3dc2d5575dd3c62567613735e | |
parent | f19076e592c0ba80aa7cd9b40bbf5e5d7727dee2 (diff) | |
download | cpython-9450cc056a19d7d12a819fa020f4f1abf805d58c.zip cpython-9450cc056a19d7d12a819fa020f4f1abf805d58c.tar.gz cpython-9450cc056a19d7d12a819fa020f4f1abf805d58c.tar.bz2 |
Fix r85728: use "" to mean the system default locale, which should work on more systems.
-rw-r--r-- | Lib/test/test_calendar.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index f906bc3..9ba7f0c 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -254,16 +254,13 @@ class CalendarTestCase(unittest.TestCase): def test_localecalendars(self): # ensure that Locale{Text,HTML}Calendar resets the locale properly # (it is still not thread-safe though) + old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) try: - def_locale = locale.getdefaultlocale() + calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10) except locale.Error: - # cannot determine a default locale -- skip test + # cannot set the system default locale -- skip rest of test return - old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) - calendar.LocaleTextCalendar( - locale=def_locale).formatmonthname(2010, 10, 10) - calendar.LocaleHTMLCalendar( - locale=def_locale).formatmonthname(2010, 10) + calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10) new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) self.assertEquals(old_october, new_october) |