Skip to content

Commit

Permalink
mypy annoyances
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochem Berends committed Jan 24, 2018
1 parent 94730dc commit d81a831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pykechain/models/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self, json, **kwargs):
self.multiplicity = json.get('multiplicity', None)

def property(self, name_or_id):
# type: (str) -> Property
"""Retrieve the property with name belonging to this part.
:param name_or_id: property name or property UUID to search for
Expand All @@ -83,13 +82,14 @@ def property(self, name_or_id):
6
"""
found = None
if is_uuid(name_or_id):
found = find(self.properties, lambda p: name_or_id == p.id)
else:
found = find(self.properties, lambda p: name_or_id == p.name)

if not found:
raise NotFoundError("Could not find property with name {}".format(name_or_id))
raise NotFoundError("Could not find property with name or id {}".format(name_or_id))

return found

Expand Down

0 comments on commit d81a831

Please sign in to comment.