Sync MonkeyPatch.delattr and setattr AttributeError messages
This commit is contained in:
parent
a43a7adddb
commit
1b53b0083b
|
@ -281,7 +281,7 @@ class MonkeyPatch:
|
|||
|
||||
if not hasattr(target, name):
|
||||
if raising:
|
||||
raise AttributeError(name)
|
||||
raise AttributeError(f"{target!r} has no attribute {name!r}")
|
||||
else:
|
||||
oldval = getattr(target, name, notset)
|
||||
# Avoid class descriptors like staticmethod/classmethod.
|
||||
|
|
Loading…
Reference in New Issue