9408: UnboundLocalError on ODF doc backend

This commit is contained in:
Paul Franklin 2016-05-16 11:47:31 +02:00 committed by romjerome
parent 1e9de5517f
commit 653e18db5a

View File

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