summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test___all__.py7
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 = []