Skip to content

Commit

Permalink
Fix #3480: Remove deprecation warning (#3481)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Jan 4, 2019
1 parent 4c7bc9f commit 0715ae7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

0 comments on commit 0715ae7

Please sign in to comment.