mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
I don't know why staring at the email to python-checkins made me
see problems with my code that I didn't see before the checkin, but: When a subtype .mro() fails, we need to reset the type whose __bases__ are being changed, too. Fix + test.
This commit is contained in:
parent
586da8fddd
commit
7e7c00db0c
2 changed files with 16 additions and 9 deletions
|
@ -3566,11 +3566,13 @@ def test_mutable_bases_with_failing_mro():
|
|||
# check here that E's gets restored.
|
||||
|
||||
E_mro_before = E.__mro__
|
||||
D_mro_before = D.__mro__
|
||||
|
||||
try:
|
||||
D.__bases__ = (C2,)
|
||||
except RuntimeError:
|
||||
vereq(E.__mro__, E_mro_before)
|
||||
vereq(D.__mro__, D_mro_before)
|
||||
else:
|
||||
raise TestFailed, "exception not propagated"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue