mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +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:
commit
20c1cdd64a
3 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue