File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,7 @@ def topological_sort(packages):
9797 raise ValueError (f"Cyclic dependency detected: { ' -> ' .join (cycle )} " )
9898
9999 # Initialize queue with packages having no dependencies
100- queue = deque ([pkg for pkg in all_packages if indegree [pkg ] == 0 and graph [pkg ]])
101-
102- for package in [pkg for pkg in all_packages if indegree [pkg ] == 0 and not graph [pkg ]]:
103- queue .append (package )
100+ queue = deque ([pkg for pkg in all_packages if indegree [pkg ] == 0 and graph [pkg ]]
104101
105102 build_order = []
106103
@@ -113,6 +110,9 @@ def topological_sort(packages):
113110 if indegree [dependent ] == 0 :
114111 queue .append (dependent )
115112
113+ for package in [pkg for pkg in all_packages if indegree [pkg ] == 0 and not graph [pkg ]]:
114+ build_order .append (package )
115+
116116 for idx_large in range (0 , len (build_order )- 2 ):
117117 for idx_small in range (0 , len (build_order )- idx_large - 1 ):
118118
You can’t perform that action at this time.
0 commit comments