aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-10 11:45:26 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-10 11:57:39 +0100
commitaea3837d4ae637af42f716acb27d7ea8394ece35 (patch)
tree77ddf3fffcc391ca7bd8784a9cf0b34562b90715 /libmproxy
parent493302d1805d49935d4ab9d2fad3311b4f3d3541 (diff)
downloadmitmproxy-aea3837d4ae637af42f716acb27d7ea8394ece35.tar.gz
mitmproxy-aea3837d4ae637af42f716acb27d7ea8394ece35.tar.bz2
mitmproxy-aea3837d4ae637af42f716acb27d7ea8394ece35.zip
remove code duplication
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/dump.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index 22a2b75c..c2a3268a 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -85,12 +85,12 @@ class DumpMaster(flow.FlowMaster):
self.set_stickyauth(options.stickyauth)
if options.outfile:
- path = os.path.expanduser(options.outfile[0])
- try:
- f = open(path, options.outfile[1])
- self.start_stream(f, self.filt)
- except IOError as v:
- raise DumpError(v.strerror)
+ err = self.start_stream_to_path(
+ options.outfile[0],
+ options.outfile[1]
+ )
+ if err:
+ raise DumpError(err)
if options.replacements:
for i in options.replacements: