Skip to content

Commit 65457c6

Browse files
committed
Mark readline module in no-gil builds.
This means: "Do not re-enable the GIL when importing rl.readline." See python/cpython#116322 See python/cpython#116882
1 parent 0a44395 commit 65457c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rl/readline.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,6 +3600,11 @@ PyInit_readline(void)
36003600
if (m == NULL)
36013601
return NULL;
36023602

3603+
#ifdef Py_GIL_DISABLED
3604+
/* Cargo-culted from Modules/readline.c
3605+
This means: "Do not re-enable the GIL when importing rl.readline." */
3606+
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
3607+
#endif
36033608
PyOS_ReadlineFunctionPointer = call_readline;
36043609

36053610
if (setup_readline(m) < 0) {

0 commit comments

Comments
 (0)