Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

updated collections to collections.abc for python 3.10 #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/babelfish/converters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@


# from https://github.com/kennethreitz/requests/blob/master/requests/structures.py
class CaseInsensitiveDict(collections.MutableMapping):
class CaseInsensitiveDict(collections.abc.MutableMapping):
"""A case-insensitive ``dict``-like object.

Implements all methods and operations of
``collections.MutableMapping`` as well as dict's ``copy``. Also
``collections.abc.MutableMapping`` as well as dict's ``copy``. Also
provides ``lower_items``.

All keys are expected to be strings. The structure remembers the
Expand Down Expand Up @@ -63,7 +63,7 @@ def lower_items(self):
)

def __eq__(self, other):
if isinstance(other, collections.Mapping):
if isinstance(other, collections.abc.Mapping):
other = CaseInsensitiveDict(other)
else:
return NotImplemented
Expand Down
8 changes: 4 additions & 4 deletions lib/dateutil/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def __init__(self, instream):
self.instream = instream
self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'
'��������������������������������'
'������������������������������')
'��������������������������������'
'������������������������������')
self.numchars = '0123456789'
self.whitespace = ' \t\r\n'
self.charstack = []
Expand Down Expand Up @@ -311,9 +311,9 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None,
if res.weekday is not None and not res.day:
ret = ret+relativedelta.relativedelta(weekday=res.weekday)
if not ignoretz:
if (isinstance(tzinfos, collections.Callable) or
if (isinstance(tzinfos, collections.abc.Callable) or
tzinfos and res.tzname in tzinfos):
if isinstance(tzinfos, collections.Callable):
if isinstance(tzinfos, collections.abc.Callable):
tzdata = tzinfos(res.tzname, res.tzoffset)
else:
tzdata = tzinfos.get(res.tzname)
Expand Down
3 changes: 2 additions & 1 deletion lib/rebulk/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"""
import copy
import itertools
from collections import defaultdict, MutableSequence
from collections import defaultdict
from collections.abc import MutableSequence

try:
from collections import OrderedDict # pylint:disable=ungrouped-imports
Expand Down
2 changes: 1 addition & 1 deletion lib/rebulk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Various utilities functions
"""
from collections import MutableSet
from collections.abc import MutableSet

from types import GeneratorType

Expand Down