summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 3c1358c..e886ae9 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3389,11 +3389,14 @@ xmlparser_close(XMLParserObject* self, PyObject* args)
if (TreeBuilder_CheckExact(self->target)) {
Py_DECREF(res);
return treebuilder_done((TreeBuilderObject*) self->target);
- } if (self->handle_close) {
+ }
+ else if (self->handle_close) {
Py_DECREF(res);
return PyObject_CallFunction(self->handle_close, "");
- } else
+ }
+ else {
return res;
+ }
}
static PyObject*