diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-11-16 13:54:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-16 13:54:44 +0100 |
commit | d17b9d62305507a93836eb6ee085fa3edd029bed (patch) | |
tree | 42f1375e63f08962a29c061abd88027f1b73176a | |
parent | a799fddee165a9c340a25a5e9c71ddfd9a631ed8 (diff) | |
download | mitmproxy-d17b9d62305507a93836eb6ee085fa3edd029bed.tar.gz mitmproxy-d17b9d62305507a93836eb6ee085fa3edd029bed.tar.bz2 mitmproxy-d17b9d62305507a93836eb6ee085fa3edd029bed.zip |
make mypy happy
-rw-r--r-- | mitmproxy/addons/export.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/addons/export.py b/mitmproxy/addons/export.py index 9d04997f..68df9374 100644 --- a/mitmproxy/addons/export.py +++ b/mitmproxy/addons/export.py @@ -13,7 +13,7 @@ from mitmproxy.utils import strutils def cleanup_request(f: flow.Flow) -> http.HTTPRequest: - if not hasattr(f, "request") or not f.request: + if not getattr(f, "request", None): raise exceptions.CommandError("Can't export flow with no request.") assert isinstance(f, http.HTTPFlow) request = f.request.copy() @@ -28,7 +28,7 @@ def cleanup_request(f: flow.Flow) -> http.HTTPRequest: def cleanup_response(f: flow.Flow) -> http.HTTPResponse: - if not hasattr(f, "response") or not f.response: + if not getattr(f, "response", None): raise exceptions.CommandError("Can't export flow with no response.") assert isinstance(f, http.HTTPFlow) response = f.response.copy() # type: ignore |