adjust code to python 3.13

This commit is contained in:
miklo 2026-02-10 19:54:44 +01:00
parent a91726e1e1
commit 5b86e4aef1
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ COMMANDS = set('MmZzLlHhVvCcSsQqTtAa')
UPPERCASE = set('MZLHVCSQTA') UPPERCASE = set('MZLHVCSQTA')
COMMAND_RE = re.compile("([MmZzLlHhVvCcSsQqTtAa])") 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 = { SVG_COLORS = {
"aliceblue": (0.941176,0.972549,1), "aliceblue": (0.941176,0.972549,1),
@ -592,7 +592,7 @@ def getPathsFromSVG(svg):
if tag.strip().lower().endswith("}href"): if tag.strip().lower().endswith("}href"):
link = tree.attrib[tag] link = tree.attrib[tag]
break break
if link is None or link[0] is not '#': if link is None or link[0] != '#':
raise KeyError raise KeyError
source = savedElements[link[1:]] source = savedElements[link[1:]]
x = 0 x = 0

View File

@ -1,6 +1,6 @@
from __future__ import division from __future__ import division
from math import sqrt, cos, sin, acos, degrees, radians, log 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 # 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. # well as a Path object that contains a sequence of path segments.