Issue #18228: Use locale.setlocale(name, None) instead of

locale.getlocale(name) in test.regrtest.saved_test_environment

locale.getlocale() parses the locale, which is useless for
saved_test_environment.
This commit is contained in:
Victor Stinner 2013-06-17 21:28:14 +02:00
parent d9ccf7fe22
commit 546ccf090e
1 changed files with 2 additions and 2 deletions

View File

@ -1232,12 +1232,12 @@ class saved_test_environment:
shutil.rmtree(support.TESTFN)
_lc = [getattr(locale, lc) for lc in dir(locale)
if lc.startswith('LC_') and lc != 'LC_ALL']
if lc.startswith('LC_')]
def get_locale(self):
pairings = []
for lc in self._lc:
try:
pairings.append((lc, locale.getlocale(lc)))
pairings.append((lc, locale.setlocale(lc, None)))
except (TypeError, ValueError):
continue
return pairings