##// END OF EJS Templates
transaction: more specific exceptions, os.unlink can raise OSError
Benoit Boissinot -
r9686:ddf2adf8 default
parent child Browse files
Show More
@@ -28,14 +28,14 b' def _playback(journal, report, opener, e'
28 if o or not unlink:
28 if o or not unlink:
29 try:
29 try:
30 opener(f, 'a').truncate(o)
30 opener(f, 'a').truncate(o)
31 except:
31 except IOError:
32 report(_("failed to truncate %s\n") % f)
32 report(_("failed to truncate %s\n") % f)
33 raise
33 raise
34 else:
34 else:
35 try:
35 try:
36 fn = opener(f).name
36 fn = opener(f).name
37 os.unlink(fn)
37 os.unlink(fn)
38 except IOError, inst:
38 except (IOError, OSError), inst:
39 if inst.errno != errno.ENOENT:
39 if inst.errno != errno.ENOENT:
40 raise
40 raise
41 os.unlink(journal)
41 os.unlink(journal)
General Comments 0
You need to be logged in to leave comments. Login now