]> granicus.if.org Git - python/commitdiff
#22751: fix test___all__ warning about modified environment in the tests. Patch...
authorEzio Melotti <ezio.melotti@gmail.com>
Sun, 2 Nov 2014 17:08:35 +0000 (19:08 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sun, 2 Nov 2014 17:08:35 +0000 (19:08 +0200)
Lib/test/test___all__.py
Misc/ACKS

index 8cc285f70a5c9eb7ad6065e09bc1724a5b8863e4..e94d984f2b94b7555eb9d200e209b21b130e2250 100644 (file)
@@ -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 = []
index 1efdab479d4f762df5f08164fc593a8e69992b79..f0950ebb027185b68db353f50d04a96e0c81b8e1 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -222,6 +222,7 @@ Per Cederqvist
 Matej Cepl
 Carl Cerecke
 Octavian Cerna
+Michael Cetrulo
 Dave Chambers
 Pascal Chambon
 John Chandler