Skip to content

Commit 5e22721

Browse files
Fix tests.
1 parent 4f09855 commit 5e22721

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_subprocess.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,24 +591,24 @@ def test_empty_env(self):
591591
def test_invalid_cmd(self):
592592
# null character in the command name
593593
cmd = sys.executable + '\0'
594-
with self.assertRaises(ValueError):
594+
with self.assertRaises((ValueError, TypeError)):
595595
subprocess.Popen([cmd, "-c", "pass"])
596596

597597
# null character in the command argument
598-
with self.assertRaises(ValueError):
598+
with self.assertRaises((ValueError, TypeError)):
599599
subprocess.Popen([sys.executable, "-c", "pass#\0"])
600600

601601
def test_invalid_env(self):
602602
# null character in the enviroment variable name
603603
newenv = os.environ.copy()
604604
newenv["FRUIT\0VEGETABLE"] = "cabbage"
605-
with self.assertRaises(ValueError):
605+
with self.assertRaises((ValueError, TypeError)):
606606
subprocess.Popen([sys.executable, "-c", "pass"], env=newenv)
607607

608608
# null character in the enviroment variable value
609609
newenv = os.environ.copy()
610610
newenv["FRUIT"] = "orange\0VEGETABLE=cabbage"
611-
with self.assertRaises(ValueError):
611+
with self.assertRaises((ValueError, TypeError)):
612612
subprocess.Popen([sys.executable, "-c", "pass"], env=newenv)
613613

614614
# equal character in the enviroment variable name

0 commit comments

Comments
 (0)