diff options
author | R David Murray <rdmurray@bitdance.com> | 2015-04-14 21:58:40 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2015-04-14 21:58:40 (GMT) |
commit | 687592def926df9730f75a3aa3469f4378b8fc52 (patch) | |
tree | 522ecd8aab21d94a7c42b464e4cfc5e1fc34342d /Lib/test/test_cmd_line.py | |
parent | 14a88abfcc5dc9d731ab4992682f4aa22a6e55c8 (diff) | |
parent | f4bbc535b9f6fdd5f4c32e0e5518bea371dd51fa (diff) | |
download | cpython-687592def926df9730f75a3aa3469f4378b8fc52.zip cpython-687592def926df9730f75a3aa3469f4378b8fc52.tar.gz cpython-687592def926df9730f75a3aa3469f4378b8fc52.tar.bz2 |
Merge: #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index abaf3bb..6ba929c 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -271,7 +271,11 @@ class CmdLineTest(unittest.TestCase): def test_displayhook_unencodable(self): for encoding in ('ascii', 'latin-1', 'utf-8'): - env = os.environ.copy() + # We are testing a PYTHON environment variable here, so we can't + # use -E, -I, or script_helper (which uses them). So instead we do + # poor-man's isolation by deleting the PYTHON vars from env. + env = {key:value for (key,value) in os.environ.copy().items() + if not key.startswith('PYTHON')} env['PYTHONIOENCODING'] = encoding p = subprocess.Popen( [sys.executable, '-i'], |