aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-03-16 18:05:35 +1300
committerGitHub <noreply@github.com>2017-03-16 18:05:35 +1300
commitb275257553d46af3f30ddb79d9963ebdc19f065e (patch)
treebb01d4f9b32d18d90ff572d96368de7448b04d93
parentfefbff4164970637f4560b7b5049674d797f500c (diff)
parent112233891d16953cba24c9efab1aba547f5f2811 (diff)
downloadmitmproxy-b275257553d46af3f30ddb79d9963ebdc19f065e.tar.gz
mitmproxy-b275257553d46af3f30ddb79d9963ebdc19f065e.tar.bz2
mitmproxy-b275257553d46af3f30ddb79d9963ebdc19f065e.zip
Merge pull request #2167 from mhils/update-dependencies
update mypy
-rw-r--r--mitmproxy/addons/view.py3
-rw-r--r--mitmproxy/contentviews/__init__.py2
-rw-r--r--mitmproxy/contentviews/xml_html.py2
-rw-r--r--setup.py2
4 files changed, 7 insertions, 2 deletions
diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py
index 3a0587b0..2218327c 100644
--- a/mitmproxy/addons/view.py
+++ b/mitmproxy/addons/view.py
@@ -241,7 +241,7 @@ class View(collections.Sequence):
self._refilter()
self.sig_store_refresh.send(self)
- def add(self, f: mitmproxy.flow.Flow) -> bool:
+ def add(self, f: mitmproxy.flow.Flow) -> None:
"""
Adds a flow to the state. If the flow already exists, it is
ignored.
@@ -371,6 +371,7 @@ class Focus:
def index(self) -> typing.Optional[int]:
if self.flow:
return self.view.index(self.flow)
+ return None
@index.setter
def index(self, idx):
diff --git a/mitmproxy/contentviews/__init__.py b/mitmproxy/contentviews/__init__.py
index c7db6690..f57b27c7 100644
--- a/mitmproxy/contentviews/__init__.py
+++ b/mitmproxy/contentviews/__init__.py
@@ -36,12 +36,14 @@ def get(name: str) -> Optional[View]:
for i in views:
if i.name.lower() == name.lower():
return i
+ return None
def get_by_shortcut(c: str) -> Optional[View]:
for i in views:
if i.prompt[1] == c:
return i
+ return None
def add(view: View) -> None:
diff --git a/mitmproxy/contentviews/xml_html.py b/mitmproxy/contentviews/xml_html.py
index 0f2ce57d..62fb939f 100644
--- a/mitmproxy/contentviews/xml_html.py
+++ b/mitmproxy/contentviews/xml_html.py
@@ -128,6 +128,7 @@ def is_inline_text(a: Token, b: Token, c: Token) -> bool:
if isinstance(a, Tag) and isinstance(b, Text) and isinstance(c, Tag):
if a.is_opening and "\n" not in b.data and c.is_closing and a.tag == c.tag:
return True
+ return False
def is_inline(prev2: Token, prev1: Token, t: Token, next1: Token, next2: Token) -> bool:
@@ -140,6 +141,7 @@ def is_inline(prev2: Token, prev1: Token, t: Token, next1: Token, next2: Token)
return True # <div></div> (start tag)
if isinstance(prev1, Tag) and prev1.is_opening and t.is_closing and prev1.tag == t.tag:
return True # <div></div> (end tag)
+ return False
class ElementStack:
diff --git a/setup.py b/setup.py
index cb1312ba..faa865df 100644
--- a/setup.py
+++ b/setup.py
@@ -96,7 +96,7 @@ setup(
'dev': [
"Flask>=0.10.1, <0.13",
"flake8>=3.2.1, <3.4",
- "mypy>=0.471, <0.480",
+ "mypy>=0.471, <0.502",
"rstcheck>=2.2, <4.0",
"tox>=2.3, <3",
"pytest>=3, <3.1",