From 7caa934291821d92e93cf1518fe0eb227694053c Mon Sep 17 00:00:00 2001 From: Tamas Nepusz Date: Mon, 15 Jul 2024 13:09:57 +0200 Subject: [PATCH] fix: replace deprecated iteritems() method from Python 2, closes #789 --- src/igraph/clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/igraph/clustering.py b/src/igraph/clustering.py index b1fca9ab4..89b34b56e 100644 --- a/src/igraph/clustering.py +++ b/src/igraph/clustering.py @@ -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: @@ -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: