diff --git a/elementpath/compat.py b/elementpath/compat.py index 2ed43541..da742772 100644 --- a/elementpath/compat.py +++ b/elementpath/compat.py @@ -19,6 +19,7 @@ string_base_type = str unicode_type = str unicode_chr = chr + from collections.abc import MutableSequence else: # noinspection PyCompatibility from urllib2 import URLError, quote as urllib_quote @@ -26,7 +27,7 @@ string_base_type = basestring unicode_type = unicode unicode_chr = unichr - + from collections import MutableSequence def add_metaclass(metaclass): diff --git a/elementpath/tdop_parser.py b/elementpath/tdop_parser.py index 7aa2393b..a4e49716 100644 --- a/elementpath/tdop_parser.py +++ b/elementpath/tdop_parser.py @@ -16,8 +16,8 @@ from unicodedata import name as unicode_name from decimal import Decimal from abc import ABCMeta -from collections import MutableSequence -from .compat import PY3, add_metaclass + +from .compat import PY3, add_metaclass, MutableSequence from .exceptions import ElementPathSyntaxError, ElementPathNameError, ElementPathValueError, ElementPathTypeError ### diff --git a/elementpath/xpath2_parser.py b/elementpath/xpath2_parser.py index e05a9dc6..0050ce1a 100644 --- a/elementpath/xpath2_parser.py +++ b/elementpath/xpath2_parser.py @@ -13,8 +13,8 @@ """ from itertools import product from abc import ABCMeta -from collections import MutableSequence +from .compat import MutableSequence from .exceptions import ElementPathError, ElementPathTypeError, ElementPathMissingContextError from .namespaces import XSD_NAMESPACE, XPATH_FUNCTIONS_NAMESPACE, XPATH_2_DEFAULT_NAMESPACES, \ XSD_NOTATION, XSD_ANY_ATOMIC_TYPE, get_namespace, qname_to_prefixed, prefixed_to_qname