Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DeprecationWarning for Python 3.9+ #7

Merged
merged 1 commit into from
Apr 24, 2020
Merged
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 pypdn/namedlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _fields_and_defaults(typename, field_names, default, rename):

# If field_names is a Mapping, change it to return the
# (field_name, default) pairs, as if it were a list.
if isinstance(field_names, _collections.Mapping):
if isinstance(field_names, _collections.abc.Mapping):
field_names = field_names.items()

# Parse and validate the field names.
Expand Down Expand Up @@ -399,7 +399,7 @@ def _nl_index(self, value, start=NO_DEFAULT, stop=NO_DEFAULT):
def _nl_update(_self, _other=None, **kwds):
if isinstance(_other, type(_self)):
_other = zip(_self._fields, _other)
elif isinstance(_other, _collections.Mapping):
elif isinstance(_other, _collections.abc.Mapping):
tmp = []
for field_name in _self._fields:
try:
Expand Down Expand Up @@ -454,7 +454,7 @@ def namedlist(typename, field_names, default=NO_DEFAULT, rename=False,
t = type(typename, (object,), type_dict)

# Register its ABC's
_collections.Sequence.register(t)
_collections.abc.Sequence.register(t)

# And return it.
return t
Expand Down