Skip to content

Commit bc5eefa

Browse files
authored
Merge pull request #315 from python-adaptive/getattr-attributeerror
raise an AttributeError when attribute doesn't exists, closes #314
2 parents d54cd70 + b388fc1 commit bc5eefa

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)