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

Remove deprecation warning #3481

Merged
merged 1 commit into from
Jan 4, 2019
Merged
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
1 change: 1 addition & 0 deletions CHANGES/3480.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace ``collections.MutableMapping`` with ``collections.abc.MutableMapping`` to avoid a deprecation warning.
4 changes: 2 additions & 2 deletions aiohttp/web_response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asyncio # noqa
import collections # noqa
import collections.abc # noqa
import datetime
import enum
import json
Expand Down Expand Up @@ -39,7 +39,7 @@
from .web_request import BaseRequest # noqa
BaseClass = MutableMapping[str, Any]
else:
BaseClass = collections.MutableMapping
BaseClass = collections.abc.MutableMapping


class ContentCoding(enum.Enum):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_web_response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import collections
import collections.abc
import datetime
import gzip
import json
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_stream_response_eq() -> None:

def test_stream_response_is_mutable_mapping() -> None:
resp = StreamResponse()
assert isinstance(resp, collections.MutableMapping)
assert isinstance(resp, collections.abc.MutableMapping)
resp['key'] = 'value'
assert 'value' == resp['key']

Expand Down