Skip to content

Commit

Permalink
fix for latest flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed May 14, 2020
1 parent 610ffe3 commit ea52556
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tensorpack/utils/concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,11 @@ def start_proc_mask_signal(proc):
for p in proc:
if isinstance(p, mp.Process):
if sys.version_info < (3, 4) or mp.get_start_method() == 'fork':
log_once(
"Starting a process with 'fork' method is not safe and may consume unnecessary extra CPU memory."
" Use 'forkserver' or 'spawn' method (available after Py3.4) instead if you run into any issues. "
"See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods on how to set them.",
log_once("""
Starting a process with 'fork' method is not safe and may consume unnecessary extra CPU memory.
Use 'forkserver' or 'spawn' method (available after Py3.4) instead if you run into any issues.
See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods on how to set them.
""".replace("\n", ""),
'warn') # noqa
p.start()

Expand Down

0 comments on commit ea52556

Please sign in to comment.