Skip to content

Commit

Permalink
fix AttributeError doesn't mention the attribute #151
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-Athene committed Aug 29, 2024
1 parent 2da65a4 commit da80dd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modelx/core/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def __getattr__(self, name):
if name in self._impl.namespace:
return self._impl.get_attr(name)
else:
raise AttributeError # Must return AttributeError for hasattr
raise AttributeError(f"Attribute '{name}' is not in space {str(self)}")
# Must return AttributeError for hasattr

def __dir__(self):
return list(self._impl.namespace.interfaces)
Expand Down

0 comments on commit da80dd3

Please sign in to comment.