def iteritems(d):
"""Return an iterator over the items of a dictionary."""
return getattr(d, 'items' if PY3 else 'iteritems')()
+
+try:
+ from collections.abc import Mapping # python >= 3.3
+except ImportError:
+ from collections import Mapping # python < 3.3
import collections
from collections import OrderedDict
from ..common.utils import struct_parse
+from ..common.py3compat import Mapping
from bisect import bisect_right
import math
from ..construct import CString, Struct, If
NameLUTEntry = collections.namedtuple('NameLUTEntry', 'cu_ofs die_ofs')
-class NameLUT(collections.Mapping):
+class NameLUT(Mapping):
"""
A "Name LUT" holds any of the tables specified by .debug_pubtypes or
.debug_pubnames sections. This is basically a dictionary where the key is