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:
parent
d9ccf7fe22
commit
546ccf090e
@ -1232,12 +1232,12 @@ class saved_test_environment:
|
|||||||
shutil.rmtree(support.TESTFN)
|
shutil.rmtree(support.TESTFN)
|
||||||
|
|
||||||
_lc = [getattr(locale, lc) for lc in dir(locale)
|
_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):
|
def get_locale(self):
|
||||||
pairings = []
|
pairings = []
|
||||||
for lc in self._lc:
|
for lc in self._lc:
|
||||||
try:
|
try:
|
||||||
pairings.append((lc, locale.getlocale(lc)))
|
pairings.append((lc, locale.setlocale(lc, None)))
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
continue
|
continue
|
||||||
return pairings
|
return pairings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user