99import os
1010import re
1111from collections import defaultdict
12- from collections .abc import Iterable , Iterator , Mapping , Sequence
12+ from collections .abc import Iterable , Mapping , Sequence
1313from contextlib import (
1414 AbstractAsyncContextManager ,
1515 AsyncExitStack ,
@@ -289,7 +289,7 @@ def is_valid_toc(toc_filename: str):
289289 )
290290 for t in tocs
291291 )
292- toc_ids_by_source : Iterator [tuple [str , ...]] = zip (* toc_ids )
292+ toc_ids_by_source : zip [tuple [str , ...]] = zip (* toc_ids )
293293 project_ids = (next (filter (None , s ), None ) for s in toc_ids_by_source )
294294
295295 else :
@@ -518,7 +518,9 @@ async def get_projects(token: str):
518518 return projects
519519
520520
521- async def get_pruned_or_updates_projects (token : str , prune_candidates : Iterable [str ]):
521+ async def get_pruned_or_updates_projects (
522+ token : str , prune_candidates : Iterable [str ]
523+ ) -> Mapping [str , Project | Literal [False ]]:
522524 async with _make_http_client (token ) as (_ , get ):
523525
524526 async def get_repo (candidate : str ):
@@ -529,12 +531,11 @@ async def get_repo(candidate: str):
529531 except aiohttp .ClientResponseError :
530532 return (candidate , False )
531533
532- repo_statuses : dict [ str , Project | Literal [ False ]] = {
534+ return {
533535 f : s
534- for c in asyncio .as_completed ([ get_repo (f ) for f in prune_candidates ] )
536+ for c in asyncio .as_completed (get_repo (f ) for f in prune_candidates )
535537 for (f , s ) in (await c ,)
536538 }
537- return repo_statuses
538539
539540
540541outcsv_argument = click .argument ("outcsv" , default = "addons.csv" )
0 commit comments