From: Yann E. MORIN Date: Sun, 25 Sep 2016 10:48:32 +0000 (+0200) Subject: bin/pwclient: fix spurious except catch X-Git-Tag: v2.0.0-rc1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f303f1edcd5afeb922ba0bb756ea64c0371873f;p=thirdparty%2Fpatchwork.git bin/pwclient: fix spurious except catch The 'with' statement does not start an exception block like 'try' would, so we get an error executing pwclient: File "/home/ymorin/bin/pwclient", line 300 except IOError: ^ SyntaxError: invalid syntax Instead, don't try to catch any exception: any failure will be propagated back up the stack and eventually cause an abort, which is anyway what the except clause was trying to do. Signed-off-by: "Yann E. MORIN" Cc: Stephen Finucane Reviewed-by: Stephen Finucane --- diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient index b63db536..ce18e541 100755 --- a/patchwork/bin/pwclient +++ b/patchwork/bin/pwclient @@ -297,9 +297,6 @@ def action_get(rpc, patch_id): with open(fname, 'w') as f: f.write(unicode(s).encode("utf-8")) print('Saved patch to %s' % fname) - except IOError: - sys.stderr.write("Failed to write to %s\n" % fname) - sys.exit(1) def action_apply(rpc, patch_id, apply_cmd=None):