Skip to content

Commit 6f6f48d

Browse files
authored
gh-103092: Support subinterpreters in _zstd (#133674)
1 parent 3f2f59a commit 6f6f48d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Modules/_zstd/_zstdmodule.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ static int _zstd_exec(PyObject *module) {
826826
// ZstdDecompressor
827827
if (add_type_to_module(module,
828828
"ZstdDecompressor",
829-
&ZstdDecompressor_type_spec,
829+
&zstddecompressor_type_spec,
830830
&mod_state->ZstdDecompressor_type) < 0) {
831831
return -1;
832832
}
@@ -890,9 +890,9 @@ _zstd_free(void *module)
890890

891891
static struct PyModuleDef_Slot _zstd_slots[] = {
892892
{Py_mod_exec, _zstd_exec},
893+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
893894
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
894-
895-
{0}
895+
{0, NULL},
896896
};
897897

898898
struct PyModuleDef _zstdmodule = {

Modules/_zstd/_zstdmodule.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ get_zstd_state_from_type(PyTypeObject *type) {
3232

3333
extern PyType_Spec zstddict_type_spec;
3434
extern PyType_Spec zstdcompressor_type_spec;
35-
extern PyType_Spec ZstdDecompressor_type_spec;
35+
extern PyType_Spec zstddecompressor_type_spec;
3636

3737
struct _zstd_state {
3838
PyObject *empty_bytes;

Modules/_zstd/decompressor.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static PyType_Slot ZstdDecompressor_slots[] = {
883883
{0}
884884
};
885885

886-
PyType_Spec ZstdDecompressor_type_spec = {
886+
PyType_Spec zstddecompressor_type_spec = {
887887
.name = "_zstd.ZstdDecompressor",
888888
.basicsize = sizeof(ZstdDecompressor),
889889
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,

0 commit comments

Comments
 (0)