summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-05-30 06:13:40 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2009-05-30 06:13:40 (GMT)
commit1b01ccd76a5dfd00efe07af0e942afe0b59de63a (patch)
tree3b6ef6011febf085aff6d91771ceeabdfbf85cae /Lib/test
parent3ad05763a6d69a93e58dfef6cc9d84f14edbb29b (diff)
downloadcpython-1b01ccd76a5dfd00efe07af0e942afe0b59de63a.zip
cpython-1b01ccd76a5dfd00efe07af0e942afe0b59de63a.tar.gz
cpython-1b01ccd76a5dfd00efe07af0e942afe0b59de63a.tar.bz2
Issue #5562: Use wcsftime for time.strftime where available.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_time.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index c2dfaca..4e21a64 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -1,7 +1,7 @@
from test import support
import time
import unittest
-
+import locale
class TimeTestCase(unittest.TestCase):
@@ -223,9 +223,24 @@ class TimeTestCase(unittest.TestCase):
t1 = time.mktime(lt1)
self.assert_(0 <= (t1-t0) < 0.2)
-def test_main():
- support.run_unittest(TimeTestCase)
+class TestLocale(unittest.TestCase):
+ def setUp(self):
+ self.oldloc = locale.setlocale(locale.LC_ALL)
+
+ def tearDown(self):
+ locale.setlocale(locale.LC_ALL, self.oldloc)
+ def test_bug_5562(self):
+ try:
+ tmp = locale.setlocale(locale.LC_ALL, "fr_FR")
+ except locale.Error:
+ # skip this test
+ return
+ # This should not cause an exception
+ time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
+
+def test_main():
+ support.run_unittest(TimeTestCase, TestLocale)
if __name__ == "__main__":
test_main()