Skip to content

Commit

Permalink
visit instance dict
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed May 15, 2023
1 parent 456d566 commit 5ee2358
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 8 additions & 0 deletions Modules/_io/_iomodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,11 @@ extern PyObject *_PyIOBase_cannot_pickle(PyObject *self, PyObject *args);
#ifdef HAVE_WINDOWS_CONSOLE_IO
extern char _PyIO_get_console_type(PyObject *);
#endif


typedef struct {
PyObject_HEAD

PyObject *dict;
PyObject *weakreflist;
} iobase;
1 change: 1 addition & 0 deletions Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,7 @@ static int
bufferediobase_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
Py_VISIT(((iobase *)self)->dict);
return 0;
}

Expand Down
7 changes: 1 addition & 6 deletions Modules/_io/iobase.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ class _io._RawIOBase "PyObject *" "clinic_state()->PyRawIOBase_Type"
* IOBase class, an abstract class
*/

typedef struct {
PyObject_HEAD

PyObject *dict;
PyObject *weakreflist;
} iobase;

PyDoc_STRVAR(iobase_doc,
"The abstract base class for all I/O classes.\n"
Expand Down Expand Up @@ -1040,6 +1034,7 @@ static int
rawiobase_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
Py_VISIT(((iobase *)self)->dict);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions Modules/_io/textio.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ static int
textiobase_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
Py_VISIT(((iobase *)self)->dict);
return 0;
}

Expand Down

0 comments on commit 5ee2358

Please sign in to comment.