@@ -390,36 +390,39 @@ async def primer(ARGS: _Args) -> int:
390390 old_typeshed_dir = old_typeshed_dir ,
391391 )
392392
393- results = [
394- project .primer_result (
395- new_type_checker = new_type_checker ,
396- old_type_checker = old_type_checker ,
397- new_typeshed = new_typeshed_dir ,
398- old_typeshed = old_typeshed_dir ,
399- new_prepend_path = ARGS .new_prepend_path ,
400- old_prepend_path = ARGS .old_prepend_path ,
401- )
402- for project in projects
403- ]
404- retcode = 0
405- for result_fut in asyncio .as_completed (results ):
406- result = await result_fut
407- if ARGS .old_success and not result .old_result .success :
408- continue
409- if ARGS .output == "full" :
410- print (result .format_full ())
411- elif ARGS .output == "diff" :
412- print (result .format_diff_only ())
413- elif ARGS .output == "concise" :
414- # using ARGS.output == "concise" also causes us to:
415- # - always pass in --no-pretty and --no-error-summary
416- concise = result .format_concise ()
417- if concise :
418- print (concise )
419- print ()
420- if not retcode and result .diff :
421- retcode = 1
422- return retcode
393+ async with asyncio .TaskGroup () as tg :
394+ results = [
395+ tg .create_task (
396+ project .primer_result (
397+ new_type_checker = new_type_checker ,
398+ old_type_checker = old_type_checker ,
399+ new_typeshed = new_typeshed_dir ,
400+ old_typeshed = old_typeshed_dir ,
401+ new_prepend_path = ARGS .new_prepend_path ,
402+ old_prepend_path = ARGS .old_prepend_path ,
403+ )
404+ )
405+ for project in projects
406+ ]
407+ retcode = 0
408+ for result_fut in asyncio .as_completed (results ):
409+ result = await result_fut
410+ if ARGS .old_success and not result .old_result .success :
411+ continue
412+ if ARGS .output == "full" :
413+ print (result .format_full ())
414+ elif ARGS .output == "diff" :
415+ print (result .format_diff_only ())
416+ elif ARGS .output == "concise" :
417+ # using ARGS.output == "concise" also causes us to:
418+ # - always pass in --no-pretty and --no-error-summary
419+ concise = result .format_concise ()
420+ if concise :
421+ print (concise )
422+ print ()
423+ if not retcode and result .diff :
424+ retcode = 1
425+ return retcode
423426
424427
425428def main () -> None :
0 commit comments