diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-06-17 19:28:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-06-17 19:28:14 (GMT) |
commit | 546ccf090e6960dadf6cae6a088d71fe42ce7b86 (patch) | |
tree | e6600d4c09b5c77433b2eed0e1d48e1c9184ff0d /Lib/test/regrtest.py | |
parent | d9ccf7fe22ebd6225e2c436e47ea6d92a8b7404a (diff) | |
download | cpython-546ccf090e6960dadf6cae6a088d71fe42ce7b86.zip cpython-546ccf090e6960dadf6cae6a088d71fe42ce7b86.tar.gz cpython-546ccf090e6960dadf6cae6a088d71fe42ce7b86.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 4170ad3..028f3b4 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 |