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.