Commits

Roland Meister  committed 674cb6e

Unify exceptions caught in EpubBuilder.copy_image_files

  • Participants
  • Parent commits 768c3d8

Comments (0)

Files changed (1)

File sphinx/builders/epub.py

                 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
                     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))