]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #24802: Update test case for ValueError in 3.5
authorMartin Panter <vadmium+py@gmail.com>
Sun, 8 Nov 2015 11:09:13 +0000 (11:09 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sun, 8 Nov 2015 11:09:13 +0000 (11:09 +0000)
Lib/test/test_compile.py

index 13bb3a2fbf6b251fbc4454dff8ee539c9cb22783..39ef723043ee82ef4d03541529160c9549ee4ebe 100644 (file)
@@ -545,10 +545,9 @@ if 1:
     def test_null_terminated(self):
         # The source code is null-terminated internally, but bytes-like
         # objects are accepted, which could be not terminated.
-        # Exception changed from TypeError to ValueError in 3.5
-        with self.assertRaisesRegex(Exception, "cannot contain null"):
+        with self.assertRaisesRegex(ValueError, "cannot contain null"):
             compile("123\x00", "<dummy>", "eval")
-        with self.assertRaisesRegex(Exception, "cannot contain null"):
+        with self.assertRaisesRegex(ValueError, "cannot contain null"):
             compile(memoryview(b"123\x00"), "<dummy>", "eval")
         code = compile(memoryview(b"123\x00")[1:-1], "<dummy>", "eval")
         self.assertEqual(eval(code), 23)