Skip to content

Commit

Permalink
Mask a problematic usage of NotImplemetedError by class Parameter
Browse files Browse the repository at this point in the history
… of module `parametertools` to trick pylint.

I added a ToDo...
  • Loading branch information
tyralla committed Mar 31, 2022
1 parent e36a19b commit 23900fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hydpy/core/parametertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# import...
# ...from standard library
from __future__ import annotations
import builtins
import copy
import inspect
import itertools
Expand Down Expand Up @@ -1393,7 +1394,9 @@ def _raise_kwargs_and_auxfile_error(self, kwargs: Mapping[str, object]) -> NoRet
)

def _raise_wrong_kwargs_error(self) -> NoReturn:
raise NotImplementedError(
# ToDo: we should stop using `NotImplementedError` this way
# To trick pylint:
raise getattr(builtins, "NotImplementedError")(
f"The value(s) of parameter {objecttools.elementphrase(self)} could not "
f"be set based on the given keyword arguments."
)
Expand Down

0 comments on commit 23900fc

Please sign in to comment.