Kaydet (Commit) 546ccf09 authored tarafından Victor Stinner's avatar Victor Stinner

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.
üst d9ccf7fe
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment