Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
_bz2 types are now immutable
  • Loading branch information
Erlend E. Aasland committed May 25, 2021
commit 5dcfbce1e40bfb4583bc3b978bd915805f15d6f5
4 changes: 2 additions & 2 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static PyType_Spec bz2_compressor_type_spec = {
// bz2_compressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
// which prevents to create a subclass.
// So calling PyType_GetModuleState() in this file is always safe.
.flags = Py_TPFLAGS_DEFAULT,
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
.slots = bz2_compressor_type_slots,
};

Expand Down Expand Up @@ -766,7 +766,7 @@ static PyType_Spec bz2_decompressor_type_spec = {
// bz2_decompressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
// which prevents to create a subclass.
// So calling PyType_GetModuleState() in this file is always safe.
.flags = Py_TPFLAGS_DEFAULT,
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
.slots = bz2_decompressor_type_slots,
};

Expand Down