Update mypy to 0.941
MODIFY
mypy-requirements.txt
mypy-requirements.txt
-mypy==0.931
+mypy==0.941
idna>=2.0.0
cryptography>=1.3.4
tornado>=6.1

MODIFY
src/urllib3/response.py
src/urllib3/response.py
@@ -770,7 +770,7 @@ class HTTPResponse(BaseHTTPResponse):
@property
def closed(self) -> bool:
if not self.auto_close:
- return io.IOBase.closed.__get__(self) # type: ignore[no-any-return, attr-defined]
+ return io.IOBase.closed.__get__(self) # type: ignore[no-any-return]
elif self._fp is None:
return True
elif hasattr(self._fp, "isclosed"):

MODIFY
src/urllib3/util/ssl_match_hostname.py
src/urllib3/util/ssl_match_hostname.py
import ipaddress
import re
+from ipaddress import IPv4Address, IPv6Address
from typing import TYPE_CHECKING, Any, Match, Optional, Tuple, Union
if TYPE_CHECKING:
@@ -74,7 +75,7 @@ def _dnsname_match(
return pat.match(hostname)
-def _ipaddress_match(ipname: Any, host_ip: str) -> bool:
+def _ipaddress_match(ipname: str, host_ip: Union[IPv4Address, IPv6Address]) -> bool:
"""Exact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this

Update mypy to 0.941