Skip to content

Commit a6f5520

Browse files
committed
Turn parent into a PyObject pointer
Suggested by @picnixz
1 parent 8c5a4e8 commit a6f5520

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/pyexpat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ pyexpat_get_state(PyObject *module)
7272

7373
/* Declarations for objects of type xmlparser */
7474

75-
typedef struct xmlparseobject {
75+
typedef struct {
7676
PyObject_HEAD
7777

7878
XML_Parser itself;
79-
struct xmlparseobject *parent;
79+
PyObject *parent; /* Parent xmlparseobject (for ref counting) */
8080
int ordered_attributes; /* Return attributes as a list. */
8181
int specified_attributes; /* Report only specified attributes. */
8282
int in_callback; /* Is a callback active? */
@@ -1080,7 +1080,7 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
10801080
new_parser->ns_prefixes = self->ns_prefixes;
10811081
new_parser->itself = XML_ExternalEntityParserCreate(self->itself, context,
10821082
encoding);
1083-
new_parser->parent = self;
1083+
new_parser->parent = (PyObject *)self;
10841084
new_parser->handlers = 0;
10851085
new_parser->intern = Py_XNewRef(self->intern);
10861086

0 commit comments

Comments
 (0)