Mercurial > hg-stable
changeset 9686:ddf2adf88b89
transaction: more specific exceptions, os.unlink can raise OSError
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sat, 31 Oct 2009 18:17:59 +0100 |
parents | a820cd39d415 |
children | c6da1cb3b255 |
files | mercurial/transaction.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/transaction.py Sat Oct 31 18:10:52 2009 +0100 +++ b/mercurial/transaction.py Sat Oct 31 18:17:59 2009 +0100 @@ -28,14 +28,14 @@ if o or not unlink: try: opener(f, 'a').truncate(o) - except: + except IOError: report(_("failed to truncate %s\n") % f) raise else: try: fn = opener(f).name os.unlink(fn) - except IOError, inst: + except (IOError, OSError), inst: if inst.errno != errno.ENOENT: raise os.unlink(journal)