@@ -591,24 +591,24 @@ def test_empty_env(self):
591
591
def test_invalid_cmd (self ):
592
592
# null character in the command name
593
593
cmd = sys .executable + '\0 '
594
- with self .assertRaises (ValueError ):
594
+ with self .assertRaises (( ValueError , TypeError ) ):
595
595
subprocess .Popen ([cmd , "-c" , "pass" ])
596
596
597
597
# null character in the command argument
598
- with self .assertRaises (ValueError ):
598
+ with self .assertRaises (( ValueError , TypeError ) ):
599
599
subprocess .Popen ([sys .executable , "-c" , "pass#\0 " ])
600
600
601
601
def test_invalid_env (self ):
602
602
# null character in the enviroment variable name
603
603
newenv = os .environ .copy ()
604
604
newenv ["FRUIT\0 VEGETABLE" ] = "cabbage"
605
- with self .assertRaises (ValueError ):
605
+ with self .assertRaises (( ValueError , TypeError ) ):
606
606
subprocess .Popen ([sys .executable , "-c" , "pass" ], env = newenv )
607
607
608
608
# null character in the enviroment variable value
609
609
newenv = os .environ .copy ()
610
610
newenv ["FRUIT" ] = "orange\0 VEGETABLE=cabbage"
611
- with self .assertRaises (ValueError ):
611
+ with self .assertRaises (( ValueError , TypeError ) ):
612
612
subprocess .Popen ([sys .executable , "-c" , "pass" ], env = newenv )
613
613
614
614
# equal character in the enviroment variable name
0 commit comments