Skip to content

Commit

Permalink
fix: remove warning on condition
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Sep 24, 2024
1 parent 1fd87dc commit 0cebef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fonts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def generate_css(opts: Namespace) -> bool:
Et.register_namespace("", SVG_NS["svg"])
svg_font: Et.ElementTree = Et.parse(str(font_pth))
font_el: Optional[Et.Element] = svg_font.find(".//svg:defs/svg:font", SVG_NS)
if not font_el:
if font_el is None:
log.error("Could not find a font element in %s", font_pth.resolve())
return False

Expand Down Expand Up @@ -482,7 +482,7 @@ def __read_svg_font_file(
) -> Optional[tuple[str, str, str, list[Et.Element]]]:
font_xml: Et.ElementTree = Et.parse(fontfile)
font_el: Optional[Et.Element] = font_xml.find("svg:defs/svg:font", SVG_NS)
if not font_el:
if font_el is None:
log.error("Could not find a font definition in %s.", fontfile)
return None

Expand Down

0 comments on commit 0cebef6

Please sign in to comment.