diff options
author | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
---|---|---|
committer | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
commit | 0e984e1442e735a6a3cee5170bead492b231d620 (patch) | |
tree | 4e0ae4b5598f3c1be35a38819b15a12ace6209c8 /mitmproxy/net | |
parent | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f (diff) | |
download | mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.gz mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.bz2 mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.zip |
fix Python 3.6 variable type annotations #3053
Diffstat (limited to 'mitmproxy/net')
-rw-r--r-- | mitmproxy/net/http/cookies.py | 4 | ||||
-rw-r--r-- | mitmproxy/net/http/message.py | 4 | ||||
-rw-r--r-- | mitmproxy/net/tls.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/mitmproxy/net/http/cookies.py b/mitmproxy/net/http/cookies.py index 39e8d60f..1472ab55 100644 --- a/mitmproxy/net/http/cookies.py +++ b/mitmproxy/net/http/cookies.py @@ -135,8 +135,8 @@ def _read_set_cookie_pairs(s: str, off=0) -> Tuple[List[TPairs], int]: off: start offset specials: attributes that are treated specially """ - cookies = [] # type: List[TPairs] - pairs = [] # type: TPairs + cookies: List[TPairs] = [] + pairs: TPairs = [] while True: lhs, off = _read_key(s, off, ";=,") diff --git a/mitmproxy/net/http/message.py b/mitmproxy/net/http/message.py index 65820f67..06d00377 100644 --- a/mitmproxy/net/http/message.py +++ b/mitmproxy/net/http/message.py @@ -8,7 +8,7 @@ from mitmproxy.net.http import headers class MessageData(serializable.Serializable): - content = None # type: bytes + content: bytes = None def __eq__(self, other): if isinstance(other, MessageData): @@ -33,7 +33,7 @@ class MessageData(serializable.Serializable): class Message(serializable.Serializable): - data = None # type: MessageData + data: MessageData = None def __eq__(self, other): if isinstance(other, Message): diff --git a/mitmproxy/net/tls.py b/mitmproxy/net/tls.py index f8eeb44b..026651a6 100644 --- a/mitmproxy/net/tls.py +++ b/mitmproxy/net/tls.py @@ -241,9 +241,9 @@ def create_client_context( # Verify hostname of leaf certificate. cert = certs.Cert(x509) try: - crt = dict( + crt: typing.Dict[str, typing.Any] = dict( subjectAltName=[("DNS", x.decode("ascii", "strict")) for x in cert.altnames] - ) # type: typing.Dict[str, typing.Any] + ) if cert.cn: crt["subject"] = [[["commonName", cert.cn.decode("ascii", "strict")]]] if sni: |