Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python 3.12 changed module init slightly (this may actually be a CPython 3.12 bug, it's not 100% clear). Before Python 3.12 the module wouldn't be available via `PyState_FindModule` until it was fully initialized. Now the module is immediately available, but in an invalid state leading to segfaults. The workaround is to manually call `PyState_AddModule` to ensure the module is always available. In the long run we should move to using multiphase module init which should avoid this problem entirely.
- Loading branch information