Skip to content

Conversation

@cphurley82
Copy link

Summary

  • Guard the legacy PyEval_ThreadsInitialized() call behind a PY_VERSION_HEX < 0x03090000 check.
  • Call PyEval_InitThreads() unconditionally on Python ≥3.9, where PyEval_ThreadsInitialized() was removed, keeping the GIL initialisation behaviour intact.
  • Preserve Python ≤3.8 behaviour (only initialise if the threads API reports “not ready”) so older interpreters see no change.

Motivation

Python 3.9 removed PyEval_ThreadsInitialized(), causing PySysC to fail at import/build time on modern interpreters with:
AttributeError: module 'cpython' has no attribute 'PyEval_ThreadsInitialized'

The new guard allows PySysC to run on Python 3.9+ without regressing older Python releases.

@markfoodyburton
Copy link
Contributor

I notice this is marked as a draft, please make sure the commit, when it's ready is signed off by you, but it looks a good patch, thanks.

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.

3 participants