summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/topological.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-11-04 06:11:21 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-11-04 06:11:21 +0000
commitef48ddc5030548298ce4b12c645dd01c860362d3 (patch)
tree698e3f919778246590f90f3f6e331cc6963430da /lib/sqlalchemy/topological.py
parent03068225263255a5f74ff97ad3d5d287d1b233da (diff)
downloadsqlalchemy-ef48ddc5030548298ce4b12c645dd01c860362d3.tar.gz
- fix to subtle condition in topological sort where a node could appear twice,
for [ticket:362]
Diffstat (limited to 'lib/sqlalchemy/topological.py')
-rw-r--r--lib/sqlalchemy/topological.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/topological.py b/lib/sqlalchemy/topological.py
index 2a9d027e7..9a7f2dd19 100644
--- a/lib/sqlalchemy/topological.py
+++ b/lib/sqlalchemy/topological.py
@@ -133,8 +133,9 @@ class QueueDependencySorter(object):
lead.cycles.add(edge[1])
if n is not None:
queue.append(n)
- if n is not lead:
- n._cyclical = True
+ for n in lead.cycles:
+ if n is not lead:
+ n._cyclical = True
# loop through cycle
# remove edges from the edge dictionary
# install the cycled nodes in the "cycle" list of one of the nodes