From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:06:56 +0000 (+0200) Subject: [3.13] gh-117142: Support Importing ctypes in Isolated Interpreters (gh-120008) X-Git-Tag: v3.13.0b2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c348e27cc1b1e7468f9c0c7d5d6e7f6160d25613;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-117142: Support Importing ctypes in Isolated Interpreters (gh-120008) This makes the support official. (cherry picked from commit dba7a167dbbd50e83e58df351f3414b7a08e0188, AKA gh-119991) Co-authored-by: Eric Snow Co-authored-by: Kirill Podoprigora --- diff --git a/Misc/NEWS.d/next/Library/2024-06-03-11-18-16.gh-issue-117142.kWTXQo.rst b/Misc/NEWS.d/next/Library/2024-06-03-11-18-16.gh-issue-117142.kWTXQo.rst new file mode 100644 index 000000000000..80734ef39463 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-06-03-11-18-16.gh-issue-117142.kWTXQo.rst @@ -0,0 +1,2 @@ +The :mod:`ctypes` module may now be imported in all subinterpreters, including +those that have their own GIL. diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 6c1e5f58b956..1d9534671a4e 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5939,7 +5939,7 @@ module_free(void *module) static PyModuleDef_Slot module_slots[] = { {Py_mod_exec, _ctypes_mod_exec}, - {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED}, + {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED}, {Py_mod_gil, Py_MOD_GIL_NOT_USED}, {0, NULL} };