From 5e22721e586344b547194f0f7ea67fd425f94e72 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 12 Jul 2017 17:31:53 +0300 Subject: [PATCH] Fix tests. --- Lib/test/test_subprocess.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index d74d8b30e9c2..9344d2100185 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -591,24 +591,24 @@ class ProcessTestCase(BaseTestCase): def test_invalid_cmd(self): # null character in the command name cmd = sys.executable + '\0' - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TypeError)): subprocess.Popen([cmd, "-c", "pass"]) # null character in the command argument - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TypeError)): subprocess.Popen([sys.executable, "-c", "pass#\0"]) def test_invalid_env(self): # null character in the enviroment variable name newenv = os.environ.copy() newenv["FRUIT\0VEGETABLE"] = "cabbage" - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TypeError)): subprocess.Popen([sys.executable, "-c", "pass"], env=newenv) # null character in the enviroment variable value newenv = os.environ.copy() newenv["FRUIT"] = "orange\0VEGETABLE=cabbage" - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TypeError)): subprocess.Popen([sys.executable, "-c", "pass"], env=newenv) # equal character in the enviroment variable name -- 2.47.3