summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-11-08 11:09:37 +0000
committerMartin Panter <vadmium+py@gmail.com>2015-11-08 11:09:37 +0000
commitcc99cd7045b1ff5e05798356e060757d9df70a80 (patch)
treecafe63223f45f1ca5208451a37077bc4d4e43440
parent7861667c8ec8c27c11a96338cb925e167c9ab9a4 (diff)
parentd61d860ed3b231aab3e6084a6b4fca9768234440 (diff)
downloadcpython-git-cc99cd7045b1ff5e05798356e060757d9df70a80.tar.gz
Issue #24802: Merge ValueError test case from 3.5
-rw-r--r--Lib/test/test_compile.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 13bb3a2fbf..39ef723043 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", "<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)