Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 0 additions & 16 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,6 @@ BZ2Compressor_dealloc(PyObject *op)
Py_DECREF(tp);
}

static int
BZ2Compressor_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
return 0;
}

static PyMethodDef BZ2Compressor_methods[] = {
_BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF
_BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF
Expand All @@ -409,7 +402,6 @@ static PyType_Slot bz2_compressor_type_slots[] = {
{Py_tp_methods, BZ2Compressor_methods},
{Py_tp_new, _bz2_BZ2Compressor},
{Py_tp_doc, (char *)_bz2_BZ2Compressor__doc__},
{Py_tp_traverse, BZ2Compressor_traverse},
{0, 0}
};

Expand Down Expand Up @@ -701,13 +693,6 @@ BZ2Decompressor_dealloc(PyObject *op)
Py_DECREF(tp);
}

static int
BZ2Decompressor_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
return 0;
}

static PyMethodDef BZ2Decompressor_methods[] = {
_BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF
{NULL}
Expand Down Expand Up @@ -738,7 +723,6 @@ static PyType_Slot bz2_decompressor_type_slots[] = {
{Py_tp_doc, (char *)_bz2_BZ2Decompressor__doc__},
{Py_tp_members, BZ2Decompressor_members},
{Py_tp_new, _bz2_BZ2Decompressor},
{Py_tp_traverse, BZ2Decompressor_traverse},
{0, 0}
};

Expand Down
16 changes: 0 additions & 16 deletions Modules/_lzmamodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,6 @@ static PyMethodDef Compressor_methods[] = {
{NULL}
};

static int
Compressor_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
return 0;
}

PyDoc_STRVAR(Compressor_doc,
"LZMACompressor(format=FORMAT_XZ, check=-1, preset=None, filters=None)\n"
"\n"
Expand Down Expand Up @@ -922,7 +915,6 @@ static PyType_Slot lzma_compressor_type_slots[] = {
{Py_tp_methods, Compressor_methods},
{Py_tp_new, Compressor_new},
{Py_tp_doc, (char *)Compressor_doc},
{Py_tp_traverse, Compressor_traverse},
{0, 0}
};

Expand Down Expand Up @@ -1325,13 +1317,6 @@ Decompressor_dealloc(PyObject *op)
Py_DECREF(tp);
}

static int
Decompressor_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
return 0;
}

static PyMethodDef Decompressor_methods[] = {
_LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF
{NULL}
Expand Down Expand Up @@ -1366,7 +1351,6 @@ static PyType_Slot lzma_decompressor_type_slots[] = {
{Py_tp_methods, Decompressor_methods},
{Py_tp_new, _lzma_LZMADecompressor},
{Py_tp_doc, (char *)_lzma_LZMADecompressor__doc__},
{Py_tp_traverse, Decompressor_traverse},
{Py_tp_members, Decompressor_members},
{0, 0}
};
Expand Down
5 changes: 1 addition & 4 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5791,7 +5791,6 @@ memory_bio_dealloc(PyObject *op)
{
PySSLMemoryBIO *self = PySSLMemoryBIO_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
(void)BIO_free(self->bio);
tp->tp_free(self);
Py_DECREF(tp);
Expand Down Expand Up @@ -5956,15 +5955,13 @@ static PyType_Slot PySSLMemoryBIO_slots[] = {
{Py_tp_getset, memory_bio_getsetlist},
{Py_tp_new, _ssl_MemoryBIO},
{Py_tp_dealloc, memory_bio_dealloc},
{Py_tp_traverse, _PyObject_VisitType},
{0, 0},
};

static PyType_Spec PySSLMemoryBIO_spec = {
.name = "_ssl.MemoryBIO",
.basicsize = sizeof(PySSLMemoryBIO),
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
Py_TPFLAGS_HAVE_GC),
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
.slots = PySSLMemoryBIO_slots,
};

Expand Down
4 changes: 1 addition & 3 deletions Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ static void
PyThreadHandleObject_dealloc(PyObject *op)
{
PyThreadHandleObject *self = PyThreadHandleObject_CAST(op);
PyObject_GC_UnTrack(self);
PyTypeObject *tp = Py_TYPE(self);
ThreadHandle_decref(self->handle);
tp->tp_free(self);
Expand Down Expand Up @@ -747,7 +746,6 @@ static PyType_Slot ThreadHandle_Type_slots[] = {
{Py_tp_dealloc, PyThreadHandleObject_dealloc},
{Py_tp_repr, PyThreadHandleObject_repr},
{Py_tp_getset, ThreadHandle_getsetlist},
{Py_tp_traverse, _PyObject_VisitType},
{Py_tp_methods, ThreadHandle_methods},
{Py_tp_new, PyThreadHandleObject_tp_new},
{0, 0}
Expand All @@ -757,7 +755,7 @@ static PyType_Spec ThreadHandle_Type_spec = {
"_thread._ThreadHandle",
sizeof(PyThreadHandleObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE,
ThreadHandle_Type_slots,
};

Expand Down
12 changes: 3 additions & 9 deletions Modules/hmacmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ _hmac_new_impl(PyObject *module, PyObject *keyobj, PyObject *msgobj,
return NULL;
}

HMACObject *self = PyObject_GC_New(HMACObject, state->hmac_type);
HMACObject *self = PyObject_New(HMACObject, state->hmac_type);
if (self == NULL) {
return NULL;
}
Expand Down Expand Up @@ -791,7 +791,6 @@ _hmac_new_impl(PyObject *module, PyObject *keyobj, PyObject *msgobj,
#endif
}
assert(rc == 0);
PyObject_GC_Track(self);
return (PyObject *)self;

error_on_key:
Expand Down Expand Up @@ -852,7 +851,7 @@ _hmac_HMAC_copy_impl(HMACObject *self, PyTypeObject *cls)
/*[clinic end generated code: output=a955bfa55b65b215 input=17b2c0ad0b147e36]*/
{
hmacmodule_state *state = get_hmacmodule_state_by_cls(cls);
HMACObject *copy = PyObject_GC_New(HMACObject, state->hmac_type);
HMACObject *copy = PyObject_New(HMACObject, state->hmac_type);
if (copy == NULL) {
return NULL;
}
Expand All @@ -870,7 +869,6 @@ _hmac_HMAC_copy_impl(HMACObject *self, PyTypeObject *cls)
}

HASHLIB_INIT_MUTEX(copy);
PyObject_GC_Track(copy);
return (PyObject *)copy;
}

Expand Down Expand Up @@ -1026,7 +1024,6 @@ static void
HMACObject_dealloc(PyObject *op)
{
PyTypeObject *type = Py_TYPE(op);
PyObject_GC_UnTrack(op);
(void)HMACObject_clear(op);
type->tp_free(op);
Py_DECREF(type);
Expand All @@ -1051,9 +1048,7 @@ static PyType_Slot HMACObject_Type_slots[] = {
{Py_tp_repr, HMACObject_repr},
{Py_tp_methods, HMACObject_methods},
{Py_tp_getset, HMACObject_getsets},
{Py_tp_clear, HMACObject_clear},
{Py_tp_dealloc, HMACObject_dealloc},
{Py_tp_traverse, _PyObject_VisitType},
{0, NULL} /* sentinel */
};

Expand All @@ -1063,8 +1058,7 @@ static PyType_Spec HMAC_Type_spec = {
.flags = Py_TPFLAGS_DEFAULT
| Py_TPFLAGS_DISALLOW_INSTANTIATION
| Py_TPFLAGS_HEAPTYPE
| Py_TPFLAGS_IMMUTABLETYPE
| Py_TPFLAGS_HAVE_GC,
| Py_TPFLAGS_IMMUTABLETYPE,
.slots = HMACObject_Type_slots,
};

Expand Down
Loading