aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/stateobject.py5
-rw-r--r--setup.py12
2 files changed, 8 insertions, 9 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)))
diff --git a/setup.py b/setup.py
index 991efa15..564eb4d7 100644
--- a/setup.py
+++ b/setup.py
@@ -65,22 +65,21 @@ setup(
"configargparse>=0.10, <0.11",
"construct>=2.5.2, <2.6",
"cryptography>=1.3, <1.5",
- "Flask>=0.10.1, <0.11",
+ "Flask>=0.10.1, <0.12",
"h2>=2.3.1, <3",
- "html2text>=2016.1.8, <=2016.4.2",
+ "html2text>=2016.1.8, <=2016.5.29",
"hyperframe>=4.0.1, <5",
"lxml>=3.5.0, <3.7",
"Pillow>=3.2, <3.3",
"passlib>=1.6.5, <1.7",
- "psutil>=4.2.0, <4.3",
+ "psutil>=4.2, <4.4",
"pyasn1>=0.1.9, <0.2",
"pyOpenSSL>=16.0, <17.0",
"pyparsing>=2.1.3, <2.2",
"pyperclip>=1.5.22, <1.6",
- "requests>=2.9.1, <2.10",
+ "requests>=2.9.1, <2.11",
"six>=1.10, <1.11",
"tornado>=4.3, <4.4",
- "typing==3.5.1.0",
"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",
@@ -117,7 +117,7 @@ setup(
'examples': [
"beautifulsoup4>=4.4.1, <4.5",
"harparser>=0.2, <0.3",
- "pytz>=2015.07.0, <=2016.3",
+ "pytz>=2015.07.0, <=2016.4",
]
}
)