aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/optmanager.py
diff options
context:
space:
mode:
authorMatthew Shao <me@matshao.com>2017-06-13 23:21:52 +0800
committerMatthew Shao <me@matshao.com>2017-06-13 23:22:43 +0800
commit1177e6d90777da92c72a1e88de93312f2ca1e6ff (patch)
treed3af4078344140a0231def5beaaa6b4c6e61c91c /mitmproxy/optmanager.py
parent2c0f6c202321a9d332dbe0181d319a3be4fd2614 (diff)
downloadmitmproxy-1177e6d90777da92c72a1e88de93312f2ca1e6ff.tar.gz
mitmproxy-1177e6d90777da92c72a1e88de93312f2ca1e6ff.tar.bz2
mitmproxy-1177e6d90777da92c72a1e88de93312f2ca1e6ff.zip
Add typesepc_to_str function to mitmproxy/utils/typechck.py
Diffstat (limited to 'mitmproxy/optmanager.py')
-rw-r--r--mitmproxy/optmanager.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/mitmproxy/optmanager.py b/mitmproxy/optmanager.py
index b67949e0..4a455282 100644
--- a/mitmproxy/optmanager.py
+++ b/mitmproxy/optmanager.py
@@ -425,14 +425,7 @@ def dump_dicts(opts):
options_list = []
for k in sorted(opts.keys()):
o = opts._options[k]
- if o.typespec in (str, int, bool):
- t = o.typespec.__name__
- elif o.typespec == typing.Optional[str]:
- t = 'Union'
- elif o.typespec == typing.Sequence[str]:
- t = 'Sequence'
- else:
- raise NotImplementedError
+ t = typecheck.typespec_to_str(o.typespec)
option = {
'name': k,
'type': t,