Skip to content

Commit

Permalink
addressed import errors for Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dbotwinick committed Aug 7, 2022
1 parent e7bdefa commit d2f7b93
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="vpd",
version="0.9.2",
version="0.9.3",
author="Drew Botwinick",
author_email="[email protected]",
description="VirtualPathDictChains. Hierarchical, Addressable Dicts, potentially using YaML",
Expand Down
7 changes: 6 additions & 1 deletion vpd/cid.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
"""

from collections import Mapping, MutableMapping, OrderedDict
from collections import OrderedDict

try:
from collections import Mapping, MutableMapping
except ImportError:
from collections.abc import Mapping, MutableMapping


class CaseInsensitiveDict(MutableMapping):
Expand Down
5 changes: 4 additions & 1 deletion vpd/cmp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# author: Drew Botwinick, Botwinick Innovations
# license: 3-clause BSD

from collections import Mapping
try:
from collections import Mapping
except ImportError:
from collections.abc import Mapping

from .iterable import is_iterable

Expand Down
9 changes: 6 additions & 3 deletions vpd/iterable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# author: Drew Botwinick, Botwinick Innovations
# license: 3-clause BSD
from collections import Mapping
try:
from collections import Mapping
except ImportError:
from collections.abc import Mapping

from six import string_types

Expand All @@ -12,8 +15,8 @@ def is_iterable(obj, strings=False, mappings=False, excluded_types=None):
when checking if iterable), but option exists to include string-types to make this more accurate to its namesake.
:param obj: object to check
:param strings: whether or not to consider strings as "iterable" for the purposes of this function
:param mappings: whether or not to consider Mappings as "iterable" for the purposes of this function
:param strings: whether to consider strings as "iterable" for the purposes of this function
:param mappings: whether to consider Mappings as "iterable" for the purposes of this function
:param excluded_types: callable single-arg function or iterable of other types to exclude from considering iterable
:return: True if iterable
"""
Expand Down

0 comments on commit d2f7b93

Please sign in to comment.