summaryrefslogtreecommitdiff
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-12-15 12:51:05 -0500
committerBenjamin Peterson <benjamin@python.org>2012-12-15 12:51:05 -0500
commit1d3d89da2d14bca62840fee637e28b0e50411c9a (patch)
treea135b338a647e0d75dbc424ebac22419bf03e12c /Lib/test/test_builtin.py
parent3ae8888e5b5a1edd3681867d4583b55fa2b6cf68 (diff)
downloadcpython-1d3d89da2d14bca62840fee637e28b0e50411c9a.tar.gz
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 19d7c7068d..2c5201e849 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