fix future warning for xml.etree

The warning was: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
This commit is contained in:
Andrej730
2023-10-31 16:24:41 +05:00
parent f6eb1b0e78
commit edfe9fbcfa
2 changed files with 2 additions and 2 deletions
@@ -534,7 +534,7 @@ class CreateDrawing(bpy.types.Operator):
root = etree.fromstring(results)
group = root.find("{http://www.w3.org/2000/svg}g")
if not group:
if group is None:
with open(svg_path, "wb") as svg:
svg.write(etree.tostring(root))
@@ -160,7 +160,7 @@ class SvgWriter:
def find_xml_symbol_by_id(self, id):
tree = ET.parse(self.resource_paths["Symbols"])
xml_symbol = tree.find(f'.//*[@id="{id}"]')
return External(xml_symbol) if xml_symbol else None
return External(xml_symbol) if xml_symbol is not None else None
def add_patterns(self):
path = self.resource_paths["Patterns"]