Fix r85728: use "" to mean the system default locale, which should work on more systems.
This commit is contained in:
parent
f19076e592
commit
9450cc056a
@ -254,16 +254,13 @@ class CalendarTestCase(unittest.TestCase):
|
|||||||
def test_localecalendars(self):
|
def test_localecalendars(self):
|
||||||
# ensure that Locale{Text,HTML}Calendar resets the locale properly
|
# ensure that Locale{Text,HTML}Calendar resets the locale properly
|
||||||
# (it is still not thread-safe though)
|
# (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)
|
old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
|
||||||
calendar.LocaleTextCalendar(
|
try:
|
||||||
locale=def_locale).formatmonthname(2010, 10, 10)
|
calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10)
|
||||||
calendar.LocaleHTMLCalendar(
|
except locale.Error:
|
||||||
locale=def_locale).formatmonthname(2010, 10)
|
# 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)
|
new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
|
||||||
self.assertEquals(old_october, new_october)
|
self.assertEquals(old_october, new_october)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user