Use `_PyThreadState_UncheckedGet()` to check that the current thread is tracked by Python before checking whether it has the GIL. The latter will abort when the former is false.
1.7 KiB
1.7 KiB