Skip to content

Commit

Permalink
raise an AttributeError when attribute doesn't exists, closes #314
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Mar 23, 2021
1 parent d54cd70 commit b388fc1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions adaptive/learner/integrator_coeffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,8 @@ def _coefficients():
return locals()


def __getattr__(attr):
return _coefficients()[attr]
def __getattr__(name):
try:
return _coefficients()[name]
except KeyError:
raise AttributeError(f"module {__name__} has no attribute {name}")

0 comments on commit b388fc1

Please sign in to comment.