mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #17901: fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
This commit is contained in:
parent
90a24270f8
commit
08231a9c6a
3 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue