Skip to content

Commit

Permalink
improve type error descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorpela committed Oct 9, 2022
1 parent 2473634 commit 7068d91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion overrides/enforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _check_if_overrides_without_overrides_decorator(name, value, bases):
continue
if not is_override:
raise TypeError(
f"Method {name} overrides but does not have @overrides decorator"
f"Method {name} overrides method from {base} but does not have @overrides decorator"
)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion overrides/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _validate_method(method, super_class, check_signature):
if hasattr(super_method, "__finalized__"):
finalized = getattr(super_method, "__finalized__")
if finalized:
raise TypeError(f"{method.__name__}: is finalized")
raise TypeError(f"{method.__name__}: is finalized in {super_class}")
if not method.__doc__:
method.__doc__ = super_method.__doc__
if (
Expand Down

0 comments on commit 7068d91

Please sign in to comment.