From: Victor Stinner Date: Mon, 17 Jun 2013 19:28:14 +0000 (+0200) Subject: Issue #18228: Use locale.setlocale(name, None) instead of X-Git-Tag: v3.4.0a1~459 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=546ccf090e6960dadf6cae6a088d71fe42ce7b86;p=python 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. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 4170ad381b..028f3b496b 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -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