From 1a4807e9293d120713e4df899499a5ba9031bd03 Mon Sep 17 00:00:00 2001 From: Andy Port Date: Mon, 6 Jul 2020 17:33:24 -0700 Subject: [PATCH] fix error related feeding str to polyline2pathd --- svgpathtools/svg_to_paths.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/svgpathtools/svg_to_paths.py b/svgpathtools/svg_to_paths.py index c787654..2dff80a 100644 --- a/svgpathtools/svg_to_paths.py +++ b/svgpathtools/svg_to_paths.py @@ -50,7 +50,11 @@ def ellipse2pathd(ellipse): def polyline2pathd(polyline, is_polygon=False): """converts the string from a polyline points-attribute to a string for a Path object d-attribute""" - points = COORD_PAIR_TMPLT.findall(polyline.get('points', '')) + if isinstance(polyline, str): + points = polyline + else: + points = COORD_PAIR_TMPLT.findall(polyline.get('points', '')) + closed = (float(points[0][0]) == float(points[-1][0]) and float(points[0][1]) == float(points[-1][1]))