From: Martin Panter Date: Sun, 8 Nov 2015 11:09:13 +0000 (+0000) Subject: Issue #24802: Update test case for ValueError in 3.5 X-Git-Tag: v3.5.1rc1~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d61d860ed3b231aab3e6084a6b4fca9768234440;p=thirdparty%2FPython%2Fcpython.git Issue #24802: Update test case for ValueError in 3.5 --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 13bb3a2fbf6b..39ef723043ee 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -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", "", "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)