Skip to content

_platform: Don't use psutil.Process.cpu_affinity on unsupported platforms

Chandan Singh requested to merge chandan/fix-cpu-count into master

psutil.Process.cpu_affinity is not available on many non-Linux platforms, like AIX and Solaris. We already have such a case with Darwin where we need to resort to using os.cpu_count().

Rather than adding more subclasses and overrides, add that logic as a fallback in the main Process class. os.cpu_count() should generally always be available, so hopefully we will only need to override this in future too much or at all.

Fixes #1244 (closed).

Merge request reports