Mercurial > hg
diff hgext/largefiles/remotestore.py @ 25079:bee00e0c2e45
largefiles: use try/except/finally
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 15 May 2015 09:55:15 -0500 |
parents | 70252bdfd39c |
children | 328739ea70c3 |
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py Fri May 15 09:54:56 2015 -0500 +++ b/hgext/largefiles/remotestore.py Fri May 15 09:55:15 2015 -0500 @@ -36,13 +36,12 @@ self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash)) fd = None try: - try: - fd = lfutil.httpsendfile(self.ui, filename) - except IOError, e: - raise util.Abort( - _('remotestore: could not open file %s: %s') - % (filename, str(e))) + fd = lfutil.httpsendfile(self.ui, filename) return self._put(hash, fd) + except IOError, e: + raise util.Abort( + _('remotestore: could not open file %s: %s') + % (filename, str(e))) finally: if fd: fd.close()