aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/utils
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2018-03-31 17:25:21 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2018-03-31 18:46:32 +0200
commit46f8901b8cf46769f62b7268117d2e60fc785c00 (patch)
tree154a2669f1dd13c2632f6387fee1d8931fe4c735 /mitmproxy/utils
parent3c52ed6ee1948a1c4b0fa064fe7313bdfadb8950 (diff)
downloadmitmproxy-46f8901b8cf46769f62b7268117d2e60fc785c00.tar.gz
mitmproxy-46f8901b8cf46769f62b7268117d2e60fc785c00.tar.bz2
mitmproxy-46f8901b8cf46769f62b7268117d2e60fc785c00.zip
Python 3.5 is dead -- long live Python 3.6!
fixes #2266
Diffstat (limited to 'mitmproxy/utils')
-rw-r--r--mitmproxy/utils/typecheck.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/mitmproxy/utils/typecheck.py b/mitmproxy/utils/typecheck.py
index 22db68f5..8ec68fa0 100644
--- a/mitmproxy/utils/typecheck.py
+++ b/mitmproxy/utils/typecheck.py
@@ -7,26 +7,17 @@ Type = typing.Union[
def sequence_type(typeinfo: typing.Type[typing.List]) -> Type:
"""Return the type of a sequence, e.g. typing.List"""
- try:
- return typeinfo.__args__[0] # type: ignore
- except AttributeError: # Python 3.5.0
- return typeinfo.__parameters__[0] # type: ignore
+ return typeinfo.__args__[0] # type: ignore
def tuple_types(typeinfo: typing.Type[typing.Tuple]) -> typing.Sequence[Type]:
"""Return the types of a typing.Tuple"""
- try:
- return typeinfo.__args__ # type: ignore
- except AttributeError: # Python 3.5.x
- return typeinfo.__tuple_params__ # type: ignore
+ return typeinfo.__args__ # type: ignore
def union_types(typeinfo: typing.Type[typing.Tuple]) -> typing.Sequence[Type]:
"""return the types of a typing.Union"""
- try:
- return typeinfo.__args__ # type: ignore
- except AttributeError: # Python 3.5.x
- return typeinfo.__union_params__ # type: ignore
+ return typeinfo.__args__ # type: ignore
def mapping_types(typeinfo: typing.Type[typing.Mapping]) -> typing.Tuple[Type, Type]: