diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-29 03:03:23 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-29 03:03:23 -0700 |
commit | 8366c87c57f8f81645d7021407e0229a81e06136 (patch) | |
tree | f444dc8c4e9779817322d7bbab992d04fd3081af | |
parent | b5a39f7d6af1c29f571578c69d7a487a24e99241 (diff) | |
download | mitmproxy-8366c87c57f8f81645d7021407e0229a81e06136.tar.gz mitmproxy-8366c87c57f8f81645d7021407e0229a81e06136.tar.bz2 mitmproxy-8366c87c57f8f81645d7021407e0229a81e06136.zip |
update to latest `typing` release
-rw-r--r-- | mitmproxy/stateobject.py | 5 | ||||
-rw-r--r-- | setup.py | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mitmproxy/stateobject.py b/mitmproxy/stateobject.py index 6283d845..8db6cda3 100644 --- a/mitmproxy/stateobject.py +++ b/mitmproxy/stateobject.py @@ -8,8 +8,7 @@ import netlib.basetypes def _is_list(cls): - # The typing module backport is somewhat broken. - # Python 3.5 or 3.6 should fix this. + # The typing module is broken on Python 3.5.0, fixed on 3.5.1. is_list_bugfix = getattr(cls, "__origin__", False) == getattr(List[Any], "__origin__", True) return issubclass(cls, List) or is_list_bugfix @@ -63,7 +62,7 @@ class StateObject(netlib.basetypes.Serializable): obj = cls.from_state(state.pop(attr)) setattr(self, attr, obj) elif _is_list(cls): - cls = cls.__parameters__[0] + cls = cls.__parameters__[0] if cls.__parameters__ else cls.__args__[0] setattr(self, attr, [cls.from_state(x) for x in state.pop(attr)]) else: # primitive types such as int, str, ... setattr(self, attr, cls(state.pop(attr))) @@ -80,7 +80,6 @@ setup( "requests>=2.9.1, <2.11", "six>=1.10, <1.11", "tornado>=4.3, <4.4", - "typing>=3.5.2, <3.6", "urwid>=1.3.1, <1.4", "watchdog>=0.8.3, <0.9", ], @@ -95,6 +94,7 @@ setup( ':python_version == "2.7"': [ "enum34>=1.0.4, <2", "ipaddress>=1.0.15, <1.1", + "typing==3.5.2.2", ], 'dev': [ "tox>=2.3, <3", |