diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-09-18 00:19:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 00:19:26 (GMT) |
commit | dbdee0073cf0b88fe541980ace1f650900f455cc (patch) | |
tree | 68551d58bdbdf451a11dbb462ff65d0c3fac1368 /Lib/test/test_sys.py | |
parent | 7a0791b6992d420dc52536257f2f093851ed7215 (diff) | |
download | cpython-dbdee0073cf0b88fe541980ace1f650900f455cc.zip cpython-dbdee0073cf0b88fe541980ace1f650900f455cc.tar.gz cpython-dbdee0073cf0b88fe541980ace1f650900f455cc.tar.bz2 |
bpo-34589: Add -X coerce_c_locale command line option (GH-9378)
Add a new -X coerce_c_locale command line option to control C locale
coercion (PEP 538).
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r-- | Lib/test/test_sys.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index b90366d..a7f2928 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -656,9 +656,8 @@ class SysModuleTest(unittest.TestCase): def c_locale_get_error_handler(self, locale, isolated=False, encoding=None): # Force the POSIX locale - env = os.environ.copy() + env = dict(os.environ) env["LC_ALL"] = locale - env["PYTHONCOERCECLOCALE"] = "0" code = '\n'.join(( 'import sys', 'def dump(name):', @@ -668,7 +667,10 @@ class SysModuleTest(unittest.TestCase): 'dump("stdout")', 'dump("stderr")', )) - args = [sys.executable, "-X", "utf8=0", "-c", code] + args = [sys.executable, + "-X", "utf8=0", + "-X", "coerce_c_locale=0", + "-c", code] if isolated: args.append("-I") if encoding is not None: |