update secp256k1 extmod for free-threaded Python builds

This commit is contained in:
The MMGen Project 2026-05-21 12:09:27 +00:00
commit efe3cd2261
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -428,12 +428,19 @@ PyMODINIT_FUNC PyInit_secp256k1(void) {
if (module == NULL)
INITERROR;
struct module_state *st = GETSTATE(module);
st->error = PyErr_NewException("secp256k1.Error", NULL, NULL);
if (st->error == NULL) {
Py_DECREF(module);
INITERROR;
}
#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif
return module;
}