diff --git a/markupsafe/__init__.py b/markupsafe/__init__.py index 0acf7355..0bd6fd23 100644 --- a/markupsafe/__init__.py +++ b/markupsafe/__init__.py @@ -9,13 +9,11 @@ :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ -from collections import Mapping - import re import string from markupsafe._compat import ( - PY2, int_types, iteritems, string_types, text_type, unichr + PY2, int_types, iteritems, string_types, text_type, unichr, Mapping ) __version__ = '1.1' diff --git a/markupsafe/_compat.py b/markupsafe/_compat.py index 7435faf5..4d2e2cd5 100644 --- a/markupsafe/_compat.py +++ b/markupsafe/_compat.py @@ -16,9 +16,11 @@ unichr = chr int_types = (int,) iteritems = lambda x: iter(x.items()) + from collections.abc import Mapping else: text_type = unicode string_types = (str, unicode) unichr = unichr int_types = (int, long) iteritems = lambda x: x.iteritems() + from collections import Mapping