aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-06-28 17:40:13 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-07-02 21:15:20 +0530
commit17b727321f659ce66d57269285c0a021db144e71 (patch)
treea7aa7ff107b5a3f85ac17cd5c49f940ff9a44403
parent5b5a3ffa8e5650012fcf278146305aabb322b975 (diff)
downloadmitmproxy-17b727321f659ce66d57269285c0a021db144e71.tar.gz
mitmproxy-17b727321f659ce66d57269285c0a021db144e71.tar.bz2
mitmproxy-17b727321f659ce66d57269285c0a021db144e71.zip
Replace map + lambda with list comprehensions
-rw-r--r--mitmproxy/flow/export.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mitmproxy/flow/export.py b/mitmproxy/flow/export.py
index f0ac02ab..bffe5291 100644
--- a/mitmproxy/flow/export.py
+++ b/mitmproxy/flow/export.py
@@ -4,7 +4,7 @@ import json
import re
from textwrap import dedent
-from six.moves.urllib.parse import quote, quote_plus
+from six.moves import urllib
import netlib.http
@@ -48,7 +48,7 @@ def python_code(flow):
print(response.text)
""").strip()
- components = map(lambda x: quote(x, safe=""), flow.request.path_components)
+ components = [urllib.parse.quote(c, safe="") for c in flow.request.path_components]
url = flow.request.scheme + "://" + flow.request.host + "/" + "/".join(components)
args = ""
@@ -126,7 +126,7 @@ def locust_code(flow):
max_wait = 3000
""").strip()
- components = map(lambda x: quote(x, safe=""), flow.request.path_components)
+ components = [urllib.parse.quote(c, safe="") for c in flow.request.path_components]
file_name = "_".join(components)
name = re.sub('\W|^(?=\d)', '_', file_name)
url = flow.request.scheme + "://" + flow.request.host + "/" + "/".join(components)