diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2014-11-02 17:08:35 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2014-11-02 17:08:35 (GMT) |
commit | 8b23f5cc7acd815a3c1d7d36143e6b3bf6347a18 (patch) | |
tree | 8d901d34d58dd2caf6b0291bc5b9b133f9b2d139 /Lib/test/test___all__.py | |
parent | 4b2b1de0bdca9020a015473c5348e1a1d4bb53f9 (diff) | |
download | cpython-8b23f5cc7acd815a3c1d7d36143e6b3bf6347a18.zip cpython-8b23f5cc7acd815a3c1d7d36143e6b3bf6347a18.tar.gz cpython-8b23f5cc7acd815a3c1d7d36143e6b3bf6347a18.tar.bz2 |
#22751: fix test___all__ warning about modified environment in the tests. Patch by Michael Cetrulo.
Diffstat (limited to 'Lib/test/test___all__.py')
-rw-r--r-- | Lib/test/test___all__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 8cc285f..e94d984 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -72,13 +72,14 @@ class AllTest(unittest.TestCase): # rlcompleter needs special consideration; it import readline which # initializes GNU readline which calls setlocale(LC_CTYPE, "")... :-( + import locale + locale_tuple = locale.getlocale(locale.LC_CTYPE) try: import rlcompleter - import locale except ImportError: pass - else: - locale.setlocale(locale.LC_CTYPE, 'C') + finally: + locale.setlocale(locale.LC_CTYPE, locale_tuple) ignored = [] failed_imports = [] |