Sync MonkeyPatch.delattr and setattr AttributeError messages

This commit is contained in:
Ganden Schaffner 2023-01-09 00:00:00 -08:00
parent a43a7adddb
commit 1b53b0083b
No known key found for this signature in database
GPG Key ID: AAF2420F20D8B553
1 changed files with 1 additions and 1 deletions

View File

@ -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.