diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-05-18 22:47:58 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-05-18 22:47:58 (GMT) |
commit | 20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a (patch) | |
tree | 86c496db3f02330cd1405521c444a2952a0b1321 /Modules/_elementtree.c | |
parent | 10e8c49a11856b26eaaf73aaee1bdad23bdbe804 (diff) | |
parent | 08231a9c6aeb8315803ede4ba3fecd378cfb1e3f (diff) | |
download | cpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.zip cpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.tar.gz cpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.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/_elementtree.c')
-rw-r--r-- | Modules/_elementtree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 7c8f5d5..aed10da 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -2341,7 +2341,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); |