Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add suggestions from sunmy2019
  • Loading branch information
Eclips4 committed May 14, 2023
commit e3174500a42be7d516a9a4c978550accbf3bb64a
15 changes: 3 additions & 12 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5478,23 +5478,14 @@ comerror_init(PyObject *self, PyObject *args, PyObject *kwds)

static int
comerror_clear(PyObject *self) {
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
PyBaseExceptionObject *obj = (PyBaseExceptionObject *) self;
Py_CLEAR(obj->dict);
Py_CLEAR(obj->args);
Py_CLEAR(obj->notes);
Py_CLEAR(obj->traceback);
Py_CLEAR(obj->cause);
Py_CLEAR(obj->context);
return 0;
return ((PyTypeObject *)PyExc_BaseException)->tp_clear(self);
Comment thread
Eclips4 marked this conversation as resolved.
}

static int
comerror_traverse(PyObject *self, visitproc visit, void *arg)
{
PyTypeObject *tp = Py_TYPE(self);
Py_VISIT(tp);
tp->tp_clear(self);
return 0;
Py_VISIT(Py_TYPE(self));
return ((PyTypeObject *)PyExc_BaseException)->tp_traverse(self, visit, arg);
}

static void
Expand Down