summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-12-15 17:51:05 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-12-15 17:51:05 (GMT)
commit9272279afdd5f102f0f1d4022da61265c5a46d04 (patch)
treecd57cf8ec8bd226b324fa3406f3e6fbf1722d1c4 /Lib/test/test_builtin.py
parent1a714750cfdd3e71a1b43ff0e34305038713e356 (diff)
downloadcpython-9272279afdd5f102f0f1d4022da61265c5a46d04.zip
cpython-9272279afdd5f102f0f1d4022da61265c5a46d04.tar.gz
cpython-9272279afdd5f102f0f1d4022da61265c5a46d04.tar.bz2
use error label instead of breaking eval loop (closes #16693)
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 19d7c70..2c5201e 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -462,6 +462,11 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, eval, ())
self.assertRaises(SyntaxError, eval, bom[:2] + b'a')
+ class X:
+ def __getitem__(self, key):
+ raise ValueError
+ self.assertRaises(ValueError, eval, "foo", {}, X())
+
def test_general_eval(self):
# Tests that general mappings can be used for the locals argument