Skip to content

Commit cf44141

Browse files
committed
reduce diff
1 parent 249ec3e commit cf44141

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Modules/_io/bufferedio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ buffered_dealloc(PyObject *op)
430430
self->lock = NULL;
431431
}
432432
(void)buffered_clear(op);
433-
tp->tp_free(op);
433+
tp->tp_free(self);
434434
Py_DECREF(tp);
435435
}
436436

Modules/_io/bytesio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ bytesio_dealloc(PyObject *op)
895895
{
896896
bytesio *self = _bytesio_CAST(op);
897897
PyTypeObject *tp = Py_TYPE(self);
898-
_PyObject_GC_UNTRACK(op);
898+
_PyObject_GC_UNTRACK(self);
899899
if (self->exports > 0) {
900900
PyErr_SetString(PyExc_SystemError,
901901
"deallocated BytesIO object has exported buffers");

Modules/_io/iobase.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,15 @@ iobase_clear(PyObject *op)
362362
/* Destructor */
363363

364364
static void
365-
iobase_dealloc(PyObject *self)
365+
iobase_dealloc(PyObject *op)
366366
{
367367
/* NOTE: since IOBaseObject has its own dict, Python-defined attributes
368368
are still available here for close() to use.
369369
However, if the derived class declares a __slots__, those slots are
370370
already gone.
371371
*/
372-
iobase *base = _iobase_CAST(self);
373-
if (_PyIOBase_finalize(self) < 0) {
372+
iobase *self = _iobase_CAST(op);
373+
if (_PyIOBase_finalize(op) < 0) {
374374
/* When called from a heap type's dealloc, the type will be
375375
decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */
376376
if (_PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) {
@@ -380,9 +380,9 @@ iobase_dealloc(PyObject *self)
380380
}
381381
PyTypeObject *tp = Py_TYPE(self);
382382
_PyObject_GC_UNTRACK(self);
383-
if (base->weakreflist != NULL)
384-
PyObject_ClearWeakRefs(self);
385-
Py_CLEAR(base->dict);
383+
if (self->weakreflist != NULL)
384+
PyObject_ClearWeakRefs(op);
385+
Py_CLEAR(self->dict);
386386
tp->tp_free(self);
387387
Py_DECREF(tp);
388388
}

0 commit comments

Comments
 (0)