]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #29273: Remove unneeded workaround to restore locale
authorMartin Panter <vadmium+py@gmail.com>
Mon, 23 Jan 2017 22:11:09 +0000 (22:11 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Mon, 23 Jan 2017 22:11:09 +0000 (22:11 +0000)
The “readline” module already has a workaround using setlocale(LC_CTYPE,
NULL). The code in test___all__ calls getlocale(), which can subtly alter
the locale string and cause the test framework to complain.

Lib/test/test___all__.py

index e94d984f2b94b7555eb9d200e209b21b130e2250..2fc5e3e3746db05e0d003ecf6252f26d20d62626 100644 (file)
@@ -70,17 +70,6 @@ class AllTest(unittest.TestCase):
             # than an AttributeError somewhere deep in CGIHTTPServer.
             import _socket
 
-        # 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
-        except ImportError:
-            pass
-        finally:
-            locale.setlocale(locale.LC_CTYPE, locale_tuple)
-
         ignored = []
         failed_imports = []
         lib_dir = os.path.dirname(os.path.dirname(__file__))