]> granicus.if.org Git - python/commitdiff
In order to make this test work on Windows, the test locale has to be
authorGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 13:15:56 +0000 (13:15 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 13:15:56 +0000 (13:15 +0000)
set to 'en' there -- Windows does not understand the 'en_US' locale.
The test succeeds there.

Lib/test/test_locale.py

index 4fb042a79985c5eaa0cabd4eb105cf08442daa11..91646ee2a07d64d1498333eb513a7fd4f016190d 100644 (file)
@@ -1,12 +1,17 @@
 from test_support import verbose
 import locale
+import sys
 
 oldlocale = locale.setlocale(locale.LC_NUMERIC)
 
+tloc = "en_US"
+if sys.platform[:3] == "win":
+    tloc = "en"
+
 try:
-    locale.setlocale(locale.LC_NUMERIC, "en_US")
+    locale.setlocale(locale.LC_NUMERIC, tloc)
 except locale.Error:
-    raise ImportError, "test locale en_US not supported"
+    raise ImportError, "test locale %s not supported" % tloc
 
 def testformat(formatstr, value, grouping = 0, output=None):
     if verbose: