aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2019-09-05 22:13:49 +0200
committerGitHub <noreply@github.com>2019-09-05 22:13:49 +0200
commite97a804e89454f5f5f546f3f99635ca8b99d75d3 (patch)
tree89d3feb751cb520f670543e1aab0d21de01e815a /examples
parent4ce5e1386c7d065f4c4f8b68aa57b0e18d6945ca (diff)
downloadmitmproxy-e97a804e89454f5f5f546f3f99635ca8b99d75d3.tar.gz
mitmproxy-e97a804e89454f5f5f546f3f99635ca8b99d75d3.tar.bz2
mitmproxy-e97a804e89454f5f5f546f3f99635ca8b99d75d3.zip
make dict comprehension more readable
Diffstat (limited to 'examples')
-rw-r--r--examples/complex/har_dump.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py
index e0964601..414b4f61 100644
--- a/examples/complex/har_dump.py
+++ b/examples/complex/har_dump.py
@@ -87,7 +87,10 @@ def response(flow):
}
# HAR timings are integers in ms, so we re-encode the raw timings to that format.
- timings = dict([(k, -1 if v is -1 else int(1000 * v)) for k, v in timings_raw.items()])
+ timings = {
+ k: int(1000 * v) if v != -1 else -1
+ for k, v in timings_raw.items()
+ }
# full_time is the sum of all timings.
# Timings set to -1 will be ignored as per spec.