Skip to content

Commit 2c67c00

Browse files
committed
oops, ig we need another loop anyway
Signed-off-by: cobalt <[email protected]>
1 parent 5b6f409 commit 2c67c00

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/black/concurrency.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from concurrent.futures import Executor, ProcessPoolExecutor, ThreadPoolExecutor
1717
from multiprocessing import Manager
1818
from pathlib import Path
19-
from typing import Any, Optional, Union
19+
from typing import Any, Optional
2020

2121
from 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

210212
def _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()

0 commit comments

Comments
 (0)