From 5b86e4aef14eda4ab8d29925be6ba9470d4c7a25 Mon Sep 17 00:00:00 2001 From: miklo Date: Tue, 10 Feb 2026 19:54:44 +0100 Subject: [PATCH] adjust code to python 3.13 --- svgpath/parser.py | 4 ++-- svgpath/path.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/svgpath/parser.py b/svgpath/parser.py index 6b320c0..c042ab1 100644 --- a/svgpath/parser.py +++ b/svgpath/parser.py @@ -10,7 +10,7 @@ COMMANDS = set('MmZzLlHhVvCcSsQqTtAa') UPPERCASE = set('MZLHVCSQTA') COMMAND_RE = re.compile("([MmZzLlHhVvCcSsQqTtAa])") -FLOAT_RE = re.compile("[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?") +FLOAT_RE = re.compile("[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?") SVG_COLORS = { "aliceblue": (0.941176,0.972549,1), @@ -592,7 +592,7 @@ def getPathsFromSVG(svg): if tag.strip().lower().endswith("}href"): link = tree.attrib[tag] break - if link is None or link[0] is not '#': + if link is None or link[0] != '#': raise KeyError source = savedElements[link[1:]] x = 0 diff --git a/svgpath/path.py b/svgpath/path.py index 51d4b6a..1ea1206 100644 --- a/svgpath/path.py +++ b/svgpath/path.py @@ -1,6 +1,6 @@ from __future__ import division from math import sqrt, cos, sin, acos, degrees, radians, log -from collections import MutableSequence +from collections.abc import MutableSequence # This file contains classes for the different types of SVG path segments as # well as a Path object that contains a sequence of path segments.