summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 88374cc..2fad8e2 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2734,6 +2734,8 @@ xmlparser_setevents(XMLParserObject* self, PyObject* args)
char* event;
if (PyUnicode_Check(item)) {
event = _PyUnicode_AsString(item);
+ if (event == NULL)
+ goto error;
} else if (PyBytes_Check(item))
event = PyBytes_AS_STRING(item);
else {