File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1616from concurrent .futures import Executor , ProcessPoolExecutor , ThreadPoolExecutor
1717from multiprocessing import Manager
1818from pathlib import Path
19- from typing import Any , Optional , Union
19+ from typing import Any , Optional
2020
2121from mypy_extensions import mypyc_attr
2222
@@ -150,7 +150,9 @@ async def schedule_formatting(
150150 WriteBack .DIFF ,
151151 WriteBack .COLOR_DIFF ,
152152 ):
153- sources_with_stats : Union [set [Path ], set [tuple [Optional [os .stat_result ], Path ]]] = sources
153+ sources_with_stats : Iterable [tuple [Optional [os .stat_result ], Path ]] = (
154+ (None , src ) for src in sources
155+ )
154156 else :
155157 sources_with_stats , cached = cache .filtered_cached (sources )
156158 for src in sorted (cached ):
@@ -208,13 +210,9 @@ async def schedule_formatting(
208210
209211
210212def _sources_sort_key (
211- source : Union [ Path , tuple [Optional [os .stat_result ], Path ] ],
213+ source : tuple [Optional [os .stat_result ], Path ],
212214) -> tuple [int , Path ]:
213- if isinstance (source , tuple ):
214- stat , src = source
215- else :
216- src = source
217- stat = None
215+ stat , src = source
218216
219217 if not stat :
220218 stat = src .stat ()
You can’t perform that action at this time.
0 commit comments