Skip to content

Commit b388fc1

Browse files
committed
raise an AttributeError when attribute doesn't exists, closes #314
1 parent d54cd70 commit b388fc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

adaptive/learner/integrator_coeffs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,8 @@ def _coefficients():
186186
return locals()
187187

188188

189-
def __getattr__(attr):
190-
return _coefficients()[attr]
189+
def __getattr__(name):
190+
try:
191+
return _coefficients()[name]
192+
except KeyError:
193+
raise AttributeError(f"module {__name__} has no attribute {name}")

0 commit comments

Comments
 (0)