9408: UnboundLocalError on ODF doc backend

This commit is contained in:
Paul Franklin 2016-05-16 11:49:09 +02:00 committed by romjerome
parent b438b9789e
commit 8921b1ad21

View File

@ -1216,7 +1216,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
try:
with open(image[0], mode='rb') as ifile:
self._add_zip(zfile, "Pictures/%s" % image[1], ifile.read(), t)
except:
except OSError as msg:
errmsg = "%s\n%s" % (_("Could not open %s") % image[0],
msg)
raise ReportError(errmsg)