From 2368627a17d08d14617e6f557d7e8d0992c7b24f Mon Sep 17 00:00:00 2001 From: Andrew Port Date: Thu, 23 Sep 2021 02:18:32 -0700 Subject: [PATCH] update --- svgpathtools/document.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/svgpathtools/document.py b/svgpathtools/document.py index e2e9a5c..b568b48 100644 --- a/svgpathtools/document.py +++ b/svgpathtools/document.py @@ -36,9 +36,15 @@ A Big Problem: # External dependencies from __future__ import division, absolute_import, print_function import os +import pdb +import sys import collections from defusedxml.cElementTree import parse, tostring -from xml.etree.cElementTree import Element, SubElement, register_namespace, ElementTree +from xml.etree.cElementTree import register_namespace +if sys.version_info.major == 2: + from xml.etree.ElementTree import Element, SubElement, ElementTree +else: + from xml.etree.cElementTree import Element, SubElement, ElementTree from defusedxml.minidom import parseString import warnings from tempfile import gettempdir @@ -98,6 +104,7 @@ def flattened_paths(group, group_filter=lambda x: True, `path_conversions=CONVERT_ONLY_PATHS`. """ if not isinstance(group, Element): + pdb.set_trace() raise TypeError('Must provide an xml.etree.Element object. ' 'Instead you provided {0}'.format(type(group)))