(original) (raw)
changeset: 99012:96cdd2532034 parent: 99010:7368b86432c6 parent: 99011:a13d9656f954 user: Martin Panter vadmium+py@gmail.com date: Sun Nov 08 11:09:37 2015 +0000 description: Issue #24802: Merge ValueError test case from 3.5 diff -r 7368b86432c6 -r 96cdd2532034 Lib/test/test_compile.py --- a/Lib/test/test_compile.py Sun Nov 08 01:05:11 2015 -0500 +++ b/Lib/test/test_compile.py Sun Nov 08 11:09:37 2015 +0000 @@ -545,10 +545,9 @@ 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", "", "eval") - with self.assertRaisesRegex(Exception, "cannot contain null"): + with self.assertRaisesRegex(ValueError, "cannot contain null"): compile(memoryview(b"123\x00"), "", "eval") code = compile(memoryview(b"123\x00")[1:-1], "", "eval") self.assertEqual(eval(code), 23)/vadmium+py@gmail.com