Hi,
Product : Community Edition, Version 8.9.6 (build 50800)
Type of error : False positive
Language : Python
Library : standard xml.etree.ElementTree library
Error : Remove this identity check; it will always be False.
Sample code:
import xml.etree.ElementTree as ET
tree = ET.ElementTree()
if tree.getroot() is None: # <- This causes a false positive
tree._setroot(ET.Element("foo"))
Why that’s not an error: tree.getroot()
returns None if the root element is not provided, else the ET.Element
object.
Thanks for your product!
Etienne Monier