Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Jul 5, 2023
1 parent cc5ddbb commit 015bb8e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lxml/etree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -855,9 +855,8 @@ cdef public class _Element [ type LxmlElementType, object LxmlElement ]:
_assertValidNode(self)
_assertValidNode(element)
if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
if element._c_node.type != tree.XML_PI_NODE:
if element._c_node.type != tree.XML_COMMENT_NODE:
raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
if element._c_node.type not in (tree.XML_PI_NODE, tree.XML_COMMENT_NODE):
raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
element.tail = None
_appendSibling(self, element)

Expand Down

0 comments on commit 015bb8e

Please sign in to comment.