Fix flake8 issue
This commit is contained in:
@@ -1 +1 @@
|
||||
Fix issue of virtualized or containerized environments not reporting the number of CPUs correctly
|
||||
Fix issue of virtualized or containerized environments not reporting the number of CPUs correctly.
|
||||
|
||||
@@ -6,13 +6,14 @@ def parse_numprocesses(s):
|
||||
if s == 'auto':
|
||||
try:
|
||||
from os import sched_getaffinity
|
||||
def cpu_count():
|
||||
return len(sched_getaffinity(0))
|
||||
except ImportError:
|
||||
try:
|
||||
from os import cpu_count
|
||||
except ImportError:
|
||||
from multiprocessing import cpu_count
|
||||
else:
|
||||
def cpu_count():
|
||||
return len(sched_getaffinity(0))
|
||||
|
||||
try:
|
||||
n = cpu_count()
|
||||
|
||||
Reference in New Issue
Block a user