summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-04-30 14:04:57 (GMT)
committerGitHub <noreply@github.com>2021-04-30 14:04:57 (GMT)
commit9746cda705decebc0ba572d95612796afd06dcd4 (patch)
treed21d7082061099687919b8e744250bb39cf5613d /Modules/zlibmodule.c
parent387397f8a4244c983f4568c16a28842e3268fe5d (diff)
downloadcpython-9746cda705decebc0ba572d95612796afd06dcd4.zip
cpython-9746cda705decebc0ba572d95612796afd06dcd4.tar.gz
cpython-9746cda705decebc0ba572d95612796afd06dcd4.tar.bz2
bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)
Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types: * _dbm.dbm * _gdbm.gdbm * _multibytecodec.MultibyteCodec * _sre..SRE_Scanner * _thread._localdummy * _thread.lock * _winapi.Overlapped * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * pyexpat.xmlparser * re.Match * re.Pattern * unicodedata.UCD * zlib.Compress * zlib.Decompress
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r--Modules/zlibmodule.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 8a20dfc..fc63ca9 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -1386,11 +1386,10 @@ static PyType_Slot Comptype_slots[] = {
};
static PyType_Spec Comptype_spec = {
- "zlib.Compress",
- sizeof(compobject),
- 0,
- Py_TPFLAGS_DEFAULT,
- Comptype_slots
+ .name = "zlib.Compress",
+ .basicsize = sizeof(compobject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots= Comptype_slots,
};
static PyType_Slot Decomptype_slots[] = {
@@ -1401,11 +1400,10 @@ static PyType_Slot Decomptype_slots[] = {
};
static PyType_Spec Decomptype_spec = {
- "zlib.Decompress",
- sizeof(compobject),
- 0,
- Py_TPFLAGS_DEFAULT,
- Decomptype_slots
+ .name = "zlib.Decompress",
+ .basicsize = sizeof(compobject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots = Decomptype_slots,
};
PyDoc_STRVAR(zlib_module_documentation,