@@ -578,7 +578,7 @@ class SpellingTask:
578578 "O" : glob .O
579579 }
580580
581- def __init__ (self , checker , config , binary = '' , verbose = 0 , jobs = 0 , debug = False , skip_dict_compile = False ):
581+ def __init__ (self , checker , config , binary = '' , verbose = 0 , jobs = None , debug = False , skip_dict_compile = False ):
582582 """Initialize."""
583583
584584 if checker == "hunspell" : # pragma: no cover
@@ -678,12 +678,12 @@ def run_task(self, task, source_patterns=None):
678678 source_patterns = self .task .get ('sources' , [])
679679
680680 # If jobs was not specified via command line, check the config for jobs settings
681- jobs = max ( 1 , self .config .get ('jobs' , 1 ) if self .jobs == 0 else self .jobs )
681+ jobs = self .config .get ('jobs' , 1 ) if self .jobs is None else self .jobs
682682
683683 expect_match = self .task .get ('expect_match' , True )
684- if jobs > 1 :
684+ if jobs != 1 and jobs > 0 :
685685 # Use multi-processing to process files concurrently
686- with ProcessPoolExecutor (max_workers = jobs ) as pool :
686+ with ProcessPoolExecutor (max_workers = jobs if jobs else None ) as pool :
687687 for results in pool .map (self .multi_check , self .walk_src (source_patterns , glob_flags , glob_limit )):
688688 self .found_match = True
689689 yield from results
@@ -711,7 +711,7 @@ def spellcheck(
711711 sources = None ,
712712 verbose = 0 ,
713713 debug = False ,
714- jobs = 0 ,
714+ jobs = None ,
715715 skip_dict_compile = False
716716):
717717 """Spell check."""
0 commit comments