mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.
This commit is contained in:
parent
27be130ec7
commit
f488fb422a
31 changed files with 101 additions and 69 deletions
|
@ -3342,7 +3342,7 @@ order (MRO) for bases """
|
|||
A.__call__ = A()
|
||||
try:
|
||||
A()()
|
||||
except RuntimeError:
|
||||
except RecursionError:
|
||||
pass
|
||||
else:
|
||||
self.fail("Recursion limit should have been reached for __call__()")
|
||||
|
@ -4317,8 +4317,8 @@ order (MRO) for bases """
|
|||
pass
|
||||
Foo.__repr__ = Foo.__str__
|
||||
foo = Foo()
|
||||
self.assertRaises(RuntimeError, str, foo)
|
||||
self.assertRaises(RuntimeError, repr, foo)
|
||||
self.assertRaises(RecursionError, str, foo)
|
||||
self.assertRaises(RecursionError, repr, foo)
|
||||
|
||||
def test_mixing_slot_wrappers(self):
|
||||
class X(dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue