aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_zstd/_zstdmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_zstd/_zstdmodule.c')
-rw-r--r--Modules/_zstd/_zstdmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_zstd/_zstdmodule.c b/Modules/_zstd/_zstdmodule.c
index bddef0d0b86..c3852fe8973 100644
--- a/Modules/_zstd/_zstdmodule.c
+++ b/Modules/_zstd/_zstdmodule.c
@@ -679,6 +679,9 @@ do { \
ADD_INT_CONST_TO_TYPE(mod_state->ZstdCompressor_type,
"FLUSH_FRAME", ZSTD_e_end);
+ /* Make ZstdCompressor immutable (set Py_TPFLAGS_IMMUTABLETYPE) */
+ PyType_Freeze(mod_state->ZstdCompressor_type);
+
#undef ADD_TYPE
#undef ADD_INT_MACRO
#undef ADD_ZSTD_COMPRESSOR_INT_CONST