Skip to content

Commit fc34986

Browse files
committed
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.
1 parent 2d996c0 commit fc34986

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/test/test_locale.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
from test_support import verbose
22
import locale
3+
import sys
34

45
oldlocale = locale.setlocale(locale.LC_NUMERIC)
56

7+
tloc = "en_US"
8+
if sys.platform[:3] == "win":
9+
tloc = "en"
10+
611
try:
7-
locale.setlocale(locale.LC_NUMERIC, "en_US")
12+
locale.setlocale(locale.LC_NUMERIC, tloc)
813
except locale.Error:
9-
raise ImportError, "test locale en_US not supported"
14+
raise ImportError, "test locale %s not supported" % tloc
1015

1116
def testformat(formatstr, value, grouping = 0, output=None):
1217
if verbose:

0 commit comments

Comments
 (0)