|
94 | 94 | ErrorTupleRaw, |
95 | 95 | report_internal_error, |
96 | 96 | ) |
97 | | -from mypy.graph_utils import prepare_sccs, strongly_connected_components, topsort |
| 97 | +from mypy.graph_utils import prepare_sccs, strongly_connected_components, topsort2 |
98 | 98 | from mypy.indirection import TypeIndirectionVisitor |
99 | 99 | from mypy.ipc import BadStatus, IPCClient, IPCMessage, read_status, ready_to_read, receive, send |
100 | 100 | from mypy.messages import MessageBuilder |
@@ -4236,7 +4236,7 @@ def sorted_components(graph: Graph) -> list[SCC]: |
4236 | 4236 | scc_dep_map = prepare_sccs_full(strongly_connected_components(vertices, edges), edges) |
4237 | 4237 | # Topsort. |
4238 | 4238 | res = [] |
4239 | | - for ready in topsort(scc_dep_map): |
| 4239 | + for ready in topsort2(scc_dep_map): |
4240 | 4240 | # Sort the sets in ready by reversed smallest State.order. Examples: |
4241 | 4241 | # |
4242 | 4242 | # - If ready is [{x}, {y}], x.order == 1, y.order == 2, we get |
@@ -4271,7 +4271,7 @@ def sorted_components_inner( |
4271 | 4271 | edges = {id: deps_filtered(graph, vertices, id, pri_max) for id in vertices} |
4272 | 4272 | sccs = list(strongly_connected_components(vertices, edges)) |
4273 | 4273 | res = [] |
4274 | | - for ready in topsort(prepare_sccs(sccs, edges)): |
| 4274 | + for ready in topsort2(prepare_sccs(sccs, edges)): |
4275 | 4275 | res.extend(sorted(ready, key=lambda scc: -min(graph[id].order for id in scc))) |
4276 | 4276 | return res |
4277 | 4277 |
|
|
0 commit comments