commit d16a94e6a64cf2d0ff9bf3e926b4e08a383faae2 Author: John Vandenberg Date: Sun Jan 9 11:31:02 2022 +0800 Use collections.abc diff --git a/hyper/common/headers.py b/hyper/common/headers.py index 655a591..6454f55 100644 --- a/hyper/common/headers.py +++ b/hyper/common/headers.py @@ -10,7 +10,7 @@ import collections from hyper.common.util import to_bytestring, to_bytestring_tuple -class HTTPHeaderMap(collections.MutableMapping): +class HTTPHeaderMap(collections.abc.MutableMapping): """ A structure that contains HTTP headers. diff --git a/hyper/http11/connection.py b/hyper/http11/connection.py index 4311d30..3405286 100644 --- a/hyper/http11/connection.py +++ b/hyper/http11/connection.py @@ -10,7 +10,7 @@ import os import socket import base64 -from collections import Iterable, Mapping +from collections.abc import Iterable, Mapping import collections from hyperframe.frame import SettingsFrame @@ -390,7 +390,7 @@ class HTTP11Connection(object): return # Iterables that set a specific content length. - elif isinstance(body, collections.Iterable): + elif isinstance(body, Iterable): for item in body: try: self._sock.send(item)