summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index df3f750..391d08c 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2735,6 +2735,15 @@ class Win32ProcessTestCase(BaseTestCase):
stdout=subprocess.PIPE,
close_fds=True)
+ @support.cpython_only
+ def test_issue31471(self):
+ # There shouldn't be an assertion failure in Popen() in case the env
+ # argument has a bad keys() method.
+ class BadEnv(dict):
+ keys = None
+ with self.assertRaises(TypeError):
+ subprocess.Popen([sys.executable, "-c", "pass"], env=BadEnv())
+
def test_close_fds(self):
# close file descriptors
rc = subprocess.call([sys.executable, "-c",