From 64c02a16c389d4fdee396f132a76a627302c7511 Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Fri, 6 Feb 2015 00:44:43 -0300 Subject: save_flow now uses with, and pyperclip requirement updated to 1.5.8 --- libmproxy/console/common.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libmproxy/console/common.py') diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index b7c46476..6141bc1c 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) -- cgit v1.2.3