Skip to content

Commit 5ee2358

Browse files
visit instance dict
1 parent 456d566 commit 5ee2358

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Modules/_io/_iomodule.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,11 @@ extern PyObject *_PyIOBase_cannot_pickle(PyObject *self, PyObject *args);
195195
#ifdef HAVE_WINDOWS_CONSOLE_IO
196196
extern char _PyIO_get_console_type(PyObject *);
197197
#endif
198+
199+
200+
typedef struct {
201+
PyObject_HEAD
202+
203+
PyObject *dict;
204+
PyObject *weakreflist;
205+
} iobase;

Modules/_io/bufferedio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,6 +2428,7 @@ static int
24282428
bufferediobase_traverse(PyObject *self, visitproc visit, void *arg)
24292429
{
24302430
Py_VISIT(Py_TYPE(self));
2431+
Py_VISIT(((iobase *)self)->dict);
24312432
return 0;
24322433
}
24332434

Modules/_io/iobase.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ class _io._RawIOBase "PyObject *" "clinic_state()->PyRawIOBase_Type"
2626
* IOBase class, an abstract class
2727
*/
2828

29-
typedef struct {
30-
PyObject_HEAD
31-
32-
PyObject *dict;
33-
PyObject *weakreflist;
34-
} iobase;
3529

3630
PyDoc_STRVAR(iobase_doc,
3731
"The abstract base class for all I/O classes.\n"
@@ -1040,6 +1034,7 @@ static int
10401034
rawiobase_traverse(PyObject *self, visitproc visit, void *arg)
10411035
{
10421036
Py_VISIT(Py_TYPE(self));
1037+
Py_VISIT(((iobase *)self)->dict);
10431038
return 0;
10441039
}
10451040

Modules/_io/textio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static int
171171
textiobase_traverse(PyObject *self, visitproc visit, void *arg)
172172
{
173173
Py_VISIT(Py_TYPE(self));
174+
Py_VISIT(((iobase *)self)->dict);
174175
return 0;
175176
}
176177

0 commit comments

Comments
 (0)