From: Serhiy Storchaka Date: Wed, 12 Jul 2017 14:31:53 +0000 (+0300) Subject: Fix tests. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e22721e586344b547194f0f7ea67fd425f94e72;p=thirdparty%2FPython%2Fcpython.git Fix tests. --- 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