# HG changeset patch # User Benoit Boissinot # Date 1257009479 -3600 # Node ID ddf2adf88b89572b8780a5223dff2269a3513240 # Parent a820cd39d41549434e3a74dde3fa3df8d2802cf0 transaction: more specific exceptions, os.unlink can raise OSError diff -r a820cd39d415 -r ddf2adf88b89 mercurial/transaction.py --- 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)