From f1174469543a36b3e6860bc4b36b8339e2bf2cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 9 Mar 2011 21:22:52 +0200 Subject: [PATCH] I hope it finally is right. --- openlp/core/ui/servicemanager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 9951c8295..73ca4b9ca 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -465,6 +465,7 @@ class ServiceManager(QtGui.QWidget): allow_zip_64 = (total_size > 2147483648 + len(service_content)) log.debug(u'ServiceManager.saveFile - allowZip64 is %s' % allow_zip_64) + zip = None try: zip = zipfile.ZipFile(path_file_name, 'w', zipfile.ZIP_STORED, allow_zip_64) @@ -477,13 +478,13 @@ class ServiceManager(QtGui.QWidget): zip.write(path_from, path_from.encode(u'utf-8')) except IOError: log.exception(u'Failed to save service to disk') - zip.close() return False finally: - zip.close() - self.mainwindow.addRecentFile(path_file_name) - self.setModified(False) - return True + if zip: + zip.close() + self.mainwindow.addRecentFile(path_file_name) + self.setModified(False) + return True def saveFileAs(self): """