Issue #17901: fix TreeBuilder construction for an explicit element_factory=None

Based on report and patch by Aaron Oakley.
This commit is contained in:
Eli Bendersky 2013-05-18 15:47:16 -07:00
parent 90a24270f8
commit 08231a9c6a
3 changed files with 8 additions and 1 deletions

View file

@ -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);