Skip to content

Commit 559f316

Browse files
committed
fix: disable GIL for free-threaded builds
1 parent e5620b9 commit 559f316

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pygit2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ PyInit__pygit2(void)
465465
if (m == NULL)
466466
return NULL;
467467

468+
#ifdef Py_GIL_DISABLED
469+
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
470+
#endif
471+
468472
/* libgit2 version info */
469473
ADD_CONSTANT_INT(m, LIBGIT2_VER_MAJOR)
470474
ADD_CONSTANT_INT(m, LIBGIT2_VER_MINOR)

0 commit comments

Comments
 (0)