Skip to content

Commit 2a3d6c3

Browse files
committed
Fix collections.abc deprecation warning
The ABCs in collections moved to the collections.abc module in 3.3 and are not available from collections from 3.8 onwards. This fix should work with any Python version (note 2.7 must also be supported).
1 parent 202fc16 commit 2a3d6c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

h2/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
from h2.errors import ErrorCodes
1616
from h2.exceptions import InvalidSettingsValueError
1717

18+
try:
19+
from collections.abc import MutableMapping
20+
except ImportError: # pragma: no cover
21+
# Python 2.7 compatibility
22+
from collections import MutableMapping
23+
1824

1925
class SettingCodes(enum.IntEnum):
2026
"""
@@ -88,7 +94,7 @@ def __repr__(self):
8894
)
8995

9096

91-
class Settings(collections.MutableMapping):
97+
class Settings(MutableMapping):
9298
"""
9399
An object that encapsulates HTTP/2 settings state.
94100

0 commit comments

Comments
 (0)