Skip to content

Commit

Permalink
Type match_hostname as request by mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Aug 20, 2020
1 parent 1926f5e commit 33c4c13
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/urllib3/packages/ssl_match_hostname/_implementation.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from typing import Dict, Tuple, Union

# https://github.com/python/typeshed/blob/master/stdlib/2and3/ssl.pyi
_PCTRTT = Tuple[Tuple[str, str], ...]
_PCTRTTT = Tuple[_PCTRTT, ...]
_PeerCertRetDictType = Dict[str, Union[str, _PCTRTTT, _PCTRTT]]
_PeerCertRetType = Union[_PeerCertRetDictType, bytes, None]

class CertificateError(ValueError): ...

def match_hostname(cert, hostname): ...
def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ...

0 comments on commit 33c4c13

Please sign in to comment.