[issue16104] Compileall script: add option to use multiple cores

Claudiu.Popa report at bugs.python.org
Sun Apr 27 15:00:19 CEST 2014


Claudiu.Popa added the comment:

Added a new patch with improvements suggested by Jim. Thanks!

I removed the handling of processes=1, because it can still be useful: having a background worker which processes the files received from _walk_dir. Also, it checks that compile_dir receives a positive *processes* value, otherwise it raises a ValueError. As a side note, I just found that ProcessPoolExecutor / ThreadPoolExecutor don't verify the value of processes, leading to certain types of errors (see issue21362 for more details).
Jim, the default for processes is still None, meaning "do not use multiple process", because the purpose of ProcessPoolExecutor makes it easy for it to use processes=None=os.cpu_count(). Here we want the user to be explicit about wanting multiple processes or not.

----------
Added file: http://bugs.python.org/file35054/issue16104_9.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16104>
_______________________________________


More information about the Python-bugs-list mailing list