Skip to content

Commit

Permalink
update find_attr (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonation committed Aug 30, 2021
1 parent 2db9fd0 commit 78b9cf6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cterasdk/common/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def find_attr(obj, path):
:returns: The attribute, or ``None`` if not found
"""
parts = None
if isinstance(path, str):
parts = re.findall('[^/]+', path)
else:
parts = path
parts = re.findall('[^/]+', path) if isinstance(path, str) else path

attr = obj
for part in parts:
Expand Down

0 comments on commit 78b9cf6

Please sign in to comment.