diff --git a/aiida/tools/graph/graph_traversers.py b/aiida/tools/graph/graph_traversers.py index 209f22bbc5..c731a4a672 100644 --- a/aiida/tools/graph/graph_traversers.py +++ b/aiida/tools/graph/graph_traversers.py @@ -209,7 +209,7 @@ def traverse_graph( # pylint: disable=too-many-locals,too-many-statements,too-many-branches if max_iterations is None: - max_iterations = inf + max_iterations = cast(int, inf) elif not (isinstance(max_iterations, int) or max_iterations is inf): raise TypeError('Max_iterations has to be an integer or infinity')