From 559f3160d7b8b57cf9ac86a97c60c0c677725015 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 11 Oct 2025 23:44:12 -0700 Subject: [PATCH] fix: disable GIL for free-threaded builds --- src/pygit2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pygit2.c b/src/pygit2.c index c2bac5e5..2649efc0 100644 --- a/src/pygit2.c +++ b/src/pygit2.c @@ -465,6 +465,10 @@ PyInit__pygit2(void) if (m == NULL) return NULL; +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED); +#endif + /* libgit2 version info */ ADD_CONSTANT_INT(m, LIBGIT2_VER_MAJOR) ADD_CONSTANT_INT(m, LIBGIT2_VER_MINOR)