mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merge: #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure.
This commit is contained in:
commit
687592def9
1 changed files with 5 additions and 1 deletions
|
@ -271,7 +271,11 @@ class CmdLineTest(unittest.TestCase):
|
||||||
|
|
||||||
def test_displayhook_unencodable(self):
|
def test_displayhook_unencodable(self):
|
||||||
for encoding in ('ascii', 'latin-1', 'utf-8'):
|
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
|
env['PYTHONIOENCODING'] = encoding
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
[sys.executable, '-i'],
|
[sys.executable, '-i'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue