summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-05-15 09:26:27 (GMT)
committerGitHub <noreply@github.com>2023-05-15 09:26:27 (GMT)
commit186bf39f5c6003912e4f445430c504db51b9a743 (patch)
tree8f1fc65f9f578bdc846d91f5dbb4c27d94927348 /Modules/_io/fileio.c
parent35bf0916d913b83cf1883b76e67ad8b1c9a25bbe (diff)
downloadcpython-186bf39f5c6003912e4f445430c504db51b9a743.zip
cpython-186bf39f5c6003912e4f445430c504db51b9a743.tar.gz
cpython-186bf39f5c6003912e4f445430c504db51b9a743.tar.bz2
gh-101819: Isolate `_io` (#101948)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r--Modules/_io/fileio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 473f0a8..30944fc 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -536,7 +536,7 @@ fileio_dealloc(fileio *self)
_PyObject_GC_UNTRACK(self);
if (self->weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
- Py_CLEAR(self->dict);
+ (void)fileio_clear(self);
tp->tp_free((PyObject *)self);
Py_DECREF(tp);
}
@@ -1166,6 +1166,8 @@ static PyMethodDef fileio_methods[] = {
_IO_FILEIO_FILENO_METHODDEF
_IO_FILEIO_ISATTY_METHODDEF
{"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL},
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
{NULL, NULL} /* sentinel */
};