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':
|
if s == 'auto':
|
||||||
try:
|
try:
|
||||||
from os import sched_getaffinity
|
from os import sched_getaffinity
|
||||||
def cpu_count():
|
|
||||||
return len(sched_getaffinity(0))
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from os import cpu_count
|
from os import cpu_count
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from multiprocessing import cpu_count
|
from multiprocessing import cpu_count
|
||||||
|
else:
|
||||||
|
def cpu_count():
|
||||||
|
return len(sched_getaffinity(0))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
n = cpu_count()
|
n = cpu_count()
|
||||||
|
|||||||
Reference in New Issue
Block a user