diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index f906bc39bd6..9ba7f0c071a 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) - try: - def_locale = locale.getdefaultlocale() - except locale.Error: - # cannot determine a default locale -- skip 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) + try: + calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10) + except locale.Error: + # cannot set the system default locale -- skip rest of test + return + calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10) new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) self.assertEquals(old_october, new_october)