Skip to content

Conversation

@moreati
Copy link
Contributor

@moreati moreati commented Jan 19, 2026

fixes #227

if not isolated:
print("ERROR: CPU affinity not available.", file=sys.stderr)
print("Use Python 3.3 or newer, or install psutil dependency")
print("Try a different OS, or install psutil dependency")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying a different OS is a surprising advice. I suggest removing it:

Suggested change
print("Try a different OS, or install psutil dependency")
print("Install psutil dependency")

Same remark below (line 424).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying a different OS is a surprising advice

I agree. I went for it because on macOS (and others) installing psutil won't help. The feature requires that the OS to expose details of the kernel scheduler. Python's docs only specify "some Unix platforms", psutils specifies it's available on "Linux, Windows, FreeBSD".

How about alternate wording? Maybe: Install psutil dependency and check psutil.Process.cpu_affinity is avaible on your OS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Install psutil dependency and check psutil.Process.cpu_affinity is avaible on your OS" sounds better, yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, and direct link to the pyproc docs in a code comment, for ease of reference.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner merged commit 188810f into psf:main Jan 21, 2026
12 checks passed
@vstinner
Copy link
Member

Merged, thanks.

maurycy added a commit to maurycy/pyperf that referenced this pull request Jan 23, 2026
* main:
  Remove fallbacks for unsupported Python versions (< 3.9) (psf#228)
  Docs: Update minimum Python version. Add matching badge (psf#226)
maurycy added a commit to maurycy/pyperf that referenced this pull request Jan 23, 2026
* main:
  Remove fallbacks for unsupported Python versions (< 3.9) (psf#228)
  Docs: Update minimum Python version. Add matching badge (psf#226)
maurycy added a commit to maurycy/pyperf that referenced this pull request Jan 23, 2026
* main:
  Remove fallbacks for unsupported Python versions (< 3.9) (psf#228)
  Docs: Update minimum Python version. Add matching badge (psf#226)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible dead code, handling unsupported python versions

2 participants