mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
use error label instead of breaking eval loop (closes #16693)
This commit is contained in:
parent
1a714750cf
commit
9272279afd
2 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue