Skip to content

Commit

Permalink
Fix xml iterators to be compatible with python 3 (#66)
Browse files Browse the repository at this point in the history
getiterator was deprecated in 2.7.  Python 3.9 has finally removed it.  iter() is the appropriate method.
  • Loading branch information
cdheiser authored Jul 7, 2021
1 parent 2c29d9b commit 054b29e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pylutron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def parse(self):
# other assets and attributes. Here we index the groups to be bound to
# Areas later.
groups = root.find('OccupancyGroups')
for group_xml in groups.getiterator('OccupancyGroup'):
for group_xml in groups.iter('OccupancyGroup'):
group = self._parse_occupancy_group(group_xml)
if group.group_number:
self._occupancy_groups[group.group_number] = group
Expand All @@ -256,7 +256,7 @@ def parse(self):
top_area = root.find('Areas').find('Area')
self.project_name = top_area.get('Name')
areas = top_area.find('Areas')
for area_xml in areas.getiterator('Area'):
for area_xml in areas.iter('Area'):
area = self._parse_area(area_xml)
self.areas.append(area)
return True
Expand Down

0 comments on commit 054b29e

Please sign in to comment.