diff --git a/pyproject.toml b/pyproject.toml index 8b8cf87b..8e874eaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,7 @@ dev = [ # floating, the two drift apart on astral's release schedule and a hook that # passes locally reddens CI on a rule the other version does not have yet. # Move both in one change. - "ruff==0.17.1", + "ruff==0.17.4", # pinned: ty is pre-1.0 and adds lint rules in patch releases, so an unpinned # floating version reddens unrelated PRs on someone else's release schedule # (0.0.69/0.0.70 added unsound-return-statement and unsound-yield; 0.0.74 diff --git a/src/smda/common/Tarjan.py b/src/smda/common/Tarjan.py index c7290ff4..e57acd6e 100644 --- a/src/smda/common/Tarjan.py +++ b/src/smda/common/Tarjan.py @@ -50,9 +50,8 @@ def calculateScc(self): call_stack.append((w, iter(graph.get(w, ())))) pushed = True break - elif w in stack_set: - if index[w] < lowlink[v]: - lowlink[v] = index[w] + elif w in stack_set and index[w] < lowlink[v]: + lowlink[v] = index[w] if pushed: continue