From 64c02a16c389d4fdee396f132a76a627302c7511 Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Fri, 6 Feb 2015 00:44:43 -0300 Subject: [PATCH] save_flow now uses with, and pyperclip requirement updated to 1.5.8 --- libmproxy/console/common.py | 5 ++--- setup.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index b7c464760..6141bc1c7 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -172,9 +172,8 @@ def save_body(path, master, state, content): state.last_saveload = path path = os.path.expanduser(path) try: - f = file(path, "wb") - f.write(str(content)) - f.close() + with file(path, "wb") as f: + f.write(content) except IOError, v: master.statusbar.message(v.strerror) diff --git a/setup.py b/setup.py index f9c8d15e8..9a19aab93 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ deps = { "pyOpenSSL>=0.14", "tornado>=4.0.2", "configargparse>=0.9.3", - "pyperclip>=1.5.7" + "pyperclip>=1.5.8" } script_deps = { "mitmproxy": {