summaryrefslogtreecommitdiff
path: root/Lib/test/test_calendar.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-20 06:50:19 +0000
committerGeorg Brandl <georg@python.org>2010-10-20 06:50:19 +0000
commit0bb5820a1cc9052680d9b6162e1df5813821b91a (patch)
tree12c21912a509e20e44dd37c5a264fb62fa47a22a /Lib/test/test_calendar.py
parent4b012507787e4ba0e24e8502d757a13e3df3624f (diff)
downloadcpython-0bb5820a1cc9052680d9b6162e1df5813821b91a.tar.gz
Fix r85728: use "" to mean the system default locale, which should work on more systems.
Diffstat (limited to 'Lib/test/test_calendar.py')
-rw-r--r--Lib/test/test_calendar.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index f906bc39bd..9ba7f0c071 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)