From 66559aaf201a7194a29b62d6f245faf6bb348750 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 28 Feb 2007 17:58:31 +0000 Subject: [PATCH] * there was an error in cycle path printing... a fix by bahadir. --- pisi/graph.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pisi/graph.py b/pisi/graph.py index d11a0dc6..1bffe0f1 100644 --- a/pisi/graph.py +++ b/pisi/graph.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2005, TUBITAK/UEKAE +# Copyright (C) 2005 - 2007, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -124,6 +124,8 @@ class Digraph(object): while self.p[u]: u = self.p[u] cycle.append(u) + if self.has_edge(cycle[0], u): + break cycle.reverse() raise CycleException(cycle) self.color[u] = 'b' # mark black (completed)