summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-05-18 22:47:16 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-05-18 22:47:16 (GMT)
commit08231a9c6aeb8315803ede4ba3fecd378cfb1e3f (patch)
tree901d68b6602b0d6eae8bd1edd33fcdcfc3393b83 /Modules
parent90a24270f8a76fffbce0a09fb0e879d9ac60cabe (diff)
downloadcpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.zip
cpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.tar.gz
cpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.tar.bz2
Issue #17901: fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 9caef99..a568cd3 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2381,7 +2381,7 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
self->data = NULL;
}
- if (self->element_factory) {
+ if (self->element_factory && self->element_factory != Py_None) {
node = PyObject_CallFunction(self->element_factory, "OO", tag, attrib);
} else {
node = create_new_element(tag, attrib);