[Python-checkins] CVS: python/dist/src/Lib/test test_locale.py,1.1,1.2
Guido van Rossum
gvanrossum@users.sourceforge.net
Sun, 15 Apr 2001 06:15:58 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv2796
Modified Files:
test_locale.py
Log Message:
In order to make this test work on Windows, the test locale has to be
set to 'en' there -- Windows does not understand the 'en_US' locale.
The test succeeds there.
Index: test_locale.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_locale.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_locale.py 2001/04/13 08:09:50 1.1
--- test_locale.py 2001/04/15 13:15:56 1.2
***************
*** 1,11 ****
from test_support import verbose
import locale
oldlocale = locale.setlocale(locale.LC_NUMERIC)
try:
! locale.setlocale(locale.LC_NUMERIC, "en_US")
except locale.Error:
! raise ImportError, "test locale en_US not supported"
def testformat(formatstr, value, grouping = 0, output=None):
--- 1,16 ----
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, tloc)
except locale.Error:
! raise ImportError, "test locale %s not supported" % tloc
def testformat(formatstr, value, grouping = 0, output=None):