From 9dff1e9501b62026525a3f72382efdc54c565d7a Mon Sep 17 00:00:00 2001 From: Rod S Date: Thu, 28 Apr 2022 19:43:30 -0700 Subject: [PATCH] Don't reinvent wheels unless the new one is particularly awesome --- src/nanoemoji/parts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nanoemoji/parts.py b/src/nanoemoji/parts.py index a800e217..12f15561 100644 --- a/src/nanoemoji/parts.py +++ b/src/nanoemoji/parts.py @@ -105,8 +105,8 @@ def fromstring(cls, string) -> "ReuseableParts": parts = cls() if first == "<": svg = SVG.fromstring(string).topicosvg() - for path in svg.xpath("//svg:path"): - parts.add(SVGPath(d=path.attrib["d"])) + for shape in svg.shapes(): + parts.add(SVGPath(d=shape.as_path().d)) elif first == "{": json_dict = json.loads(string) parts.version = tuple(int(v) for v in json_dict.pop("version").split("."))