mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Give more detailed info about exception determining image type.
This commit is contained in:
parent
9a0859fea8
commit
43c0c87136
@ -818,9 +818,10 @@ class BuildEnvironment:
|
||||
imgtype = imghdr.what(f)
|
||||
finally:
|
||||
f.close()
|
||||
except (OSError, IOError):
|
||||
self.warn(docname,
|
||||
'image file %s not readable' % filename)
|
||||
except (OSError, IOError), err:
|
||||
self.warn(docname, 'image file %s not '
|
||||
'readable: %s' % (filename, err),
|
||||
node.line)
|
||||
if imgtype:
|
||||
candidates['image/' + imgtype] = new_imgpath
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user