diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-11 22:13:50 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-11 22:13:50 (GMT) |
commit | fd4722cacf4885c29d358b8de6718b51a8149fa3 (patch) | |
tree | b6868d551a73bdc223a1263483f61072e41eb932 /Lib/test | |
parent | 73abc527eb3e4b88f30b70e5404365ed24f545c9 (diff) | |
download | cpython-fd4722cacf4885c29d358b8de6718b51a8149fa3.zip cpython-fd4722cacf4885c29d358b8de6718b51a8149fa3.tar.gz cpython-fd4722cacf4885c29d358b8de6718b51a8149fa3.tar.bz2 |
Issue #9548: Add a minimal "_bootlocale" module that is imported by the _io module instead of the full locale module.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 637b1bf..840577d 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -883,8 +883,9 @@ class ProcessTestCase(BaseTestCase): # # UTF-16 and UTF-32-BE are sufficient to check both with BOM and # without, and UTF-16 and UTF-32. + import _bootlocale for encoding in ['utf-16', 'utf-32-be']: - old_getpreferredencoding = locale.getpreferredencoding + old_getpreferredencoding = _bootlocale.getpreferredencoding # Indirectly via io.TextIOWrapper, Popen() defaults to # locale.getpreferredencoding(False) and earlier in Python 3.2 to # locale.getpreferredencoding(). @@ -895,7 +896,7 @@ class ProcessTestCase(BaseTestCase): encoding) args = [sys.executable, '-c', code] try: - locale.getpreferredencoding = getpreferredencoding + _bootlocale.getpreferredencoding = getpreferredencoding # We set stdin to be non-None because, as of this writing, # a different code path is used when the number of pipes is # zero or one. @@ -904,7 +905,7 @@ class ProcessTestCase(BaseTestCase): stdout=subprocess.PIPE) stdout, stderr = popen.communicate(input='') finally: - locale.getpreferredencoding = old_getpreferredencoding + _bootlocale.getpreferredencoding = old_getpreferredencoding self.assertEqual(stdout, '1\n2\n3\n4') def test_no_leaking(self): |