mirror of
https://github.com/python/cpython
synced 2026-09-29 10:35:30 +03:00
Allow AttributeError as well as TypeError for attribute-less objects.
This commit is contained in:
parent
c4416d5a2c
commit
6d94627f1e
1 changed files with 1 additions and 1 deletions
|
|
@ -481,7 +481,7 @@ def objects():
|
|||
verify(not hasattr(a, "foo"))
|
||||
try:
|
||||
a.foo = 12
|
||||
except TypeError:
|
||||
except (AttributeError, TypeError):
|
||||
pass
|
||||
else:
|
||||
verify(0, "object() should not allow setting a foo attribute")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue