Skip to content

Commit

Permalink
fix future warning for xml.etree
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andrej730 committed Oct 31, 2023
1 parent 235e89a commit 038d3bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/blenderbim/blenderbim/bim/module/drawing/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def generate_linework(self, context):
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))

Expand Down
2 changes: 1 addition & 1 deletion src/blenderbim/blenderbim/bim/module/drawing/svgwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def add_symbols(self):
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"]
Expand Down

0 comments on commit 038d3bc

Please sign in to comment.