Skip to content

Commit

Permalink
add apostrophes for more readability
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Sep 22, 2024
1 parent 3bb4c9c commit f856132
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyiron_workflow/mixin/semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ def __getattr__(self, key):
return self._children[key]
except KeyError:
# Raise an attribute error from getattr to make sure hasattr works well!
msg = f"Could not find attribute {key} on {self.label} "
msg = f"Could not find attribute '{key}' on {self.label} "
msg += f"({self.__class__.__name__}) or among its children "
msg += f"({self._children.keys()})."
matches = get_close_matches(key, self._children.keys(), cutoff=0.8)
if len(matches) > 0:
msg += f" Did you mean {matches[0]} and not {key}?"
msg += f" Did you mean '{matches[0]}' and not '{key}'?"
raise AttributeError(msg)

def __iter__(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/mixin/test_semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_getattr(self):
with self.assertRaises(AttributeError) as context:
_ = self.middle1.Middle_sub
self.assertIn(
"Did you mean middle_sub and not Middle_sub",
"Did you mean 'middle_sub' and not 'Middle_sub'",
str(context.exception),
msg="middle_sub must be suggested as it is close to Middle_sub"
)
Expand Down

0 comments on commit f856132

Please sign in to comment.