mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Unify exceptions caught in EpubBuilder.copy_image_files
This commit is contained in:
parent
dfd9f1cdc8
commit
f010460438
@ -410,7 +410,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
try:
|
||||
copyfile(path.join(self.srcdir, src),
|
||||
path.join(self.outdir, '_images', dest))
|
||||
except Exception, err:
|
||||
except (IOError, OSError), err:
|
||||
self.warn('cannot copy image file %r: %s' %
|
||||
(path.join(self.srcdir, src), err))
|
||||
continue
|
||||
@ -426,7 +426,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
img = img.resize((nw, nh), Image.BICUBIC)
|
||||
try:
|
||||
img.save(path.join(self.outdir, '_images', dest))
|
||||
except IOError, err:
|
||||
except (IOError, OSError), err:
|
||||
self.warn('cannot write image file %r: %s' %
|
||||
(path.join(self.srcdir, src), err))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user