summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-06-17 18:40:05 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-06-17 18:40:05 (GMT)
commitd9ccf7fe22ebd6225e2c436e47ea6d92a8b7404a (patch)
treec783abc1d12129e4ef572b5f75d1b9074705c89d /Lib/test/regrtest.py
parenta222de1a230a39cc59d060c67b25bd39d54cf466 (diff)
downloadcpython-d9ccf7fe22ebd6225e2c436e47ea6d92a8b7404a.zip
cpython-d9ccf7fe22ebd6225e2c436e47ea6d92a8b7404a.tar.gz
cpython-d9ccf7fe22ebd6225e2c436e47ea6d92a8b7404a.tar.bz2
Issue #18228: Fix locale test of test.regrtest.saved_test_environment
Skip LC_ALL becore getlocale(locale.LC_ALL) always fail, and catch also ValueError.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index e0ad0d3..4170ad3 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1231,13 +1231,14 @@ class saved_test_environment:
elif os.path.isdir(support.TESTFN):
shutil.rmtree(support.TESTFN)
- _lc = [getattr(locale, lc) for lc in dir(locale) if lc.startswith('LC_')]
+ _lc = [getattr(locale, lc) for lc in dir(locale)
+ if lc.startswith('LC_') and lc != 'LC_ALL']
def get_locale(self):
pairings = []
for lc in self._lc:
try:
pairings.append((lc, locale.getlocale(lc)))
- except TypeError:
+ except (TypeError, ValueError):
continue
return pairings
def restore_locale(self, saved):