Skip to content

Commit

Permalink
[fix] handle getting attribute on NodeList
Browse files Browse the repository at this point in the history
  • Loading branch information
ibizaman committed Dec 20, 2016
1 parent b4e82be commit 7de730d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redbaron/base_nodes.py
Expand Up @@ -632,7 +632,10 @@ def _get_list_attribute_is_member_off(self):
if self.on_attribute is "root":
in_list = self.parent
elif self.on_attribute is not None:
in_list = getattr(self.parent, self.on_attribute)
if isinstance(self.parent, NodeList):
in_list = getattr(self.parent.parent, self.on_attribute)
else:
in_list = getattr(self.parent, self.on_attribute)
else:
return None

Expand Down

0 comments on commit 7de730d

Please sign in to comment.