Skip to content

Commit

Permalink
fix: replace deprecated iteritems() method from Python 2, closes #789
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Jul 15, 2024
1 parent 94ee2d6 commit 7caa934
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/igraph/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ def _handle_mark_groups_arg_for_clustering(mark_groups, clustering):
if mark_groups is True:
group_iter = ((group, color) for color, group in enumerate(clustering))
elif isinstance(mark_groups, dict):
group_iter = mark_groups.iteritems()
group_iter = mark_groups.items()
elif hasattr(mark_groups, "__getitem__") and hasattr(mark_groups, "__len__"):
# Lists, tuples
try:
Expand All @@ -1399,7 +1399,7 @@ def _handle_mark_groups_arg_for_clustering(mark_groups, clustering):
# Iterators etc
group_iter = mark_groups
else:
group_iter = {}.iteritems()
group_iter = {}.items()

def cluster_index_resolver():
for group, color in group_iter:
Expand Down

0 comments on commit 7caa934

Please sign in to comment.