summaryrefslogtreecommitdiff
path: root/morphlib/mountableimage.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/mountableimage.py')
-rw-r--r--morphlib/mountableimage.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/morphlib/mountableimage.py b/morphlib/mountableimage.py
index f767228a..dcc496e7 100644
--- a/morphlib/mountableimage.py
+++ b/morphlib/mountableimage.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2013,2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -10,8 +10,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# with this program. If not, see <http://www.gnu.org/licenses/>.
import cliapp
@@ -46,7 +45,7 @@ class MountableImage(object): # pragma: no cover
infh = gzip.open(path, "rb")
morphlib.util.copyfileobj(infh, outfh)
infh.close()
- except BaseException, e:
+ except BaseException as e:
logging.error('Caught exception: %s' % str(e))
logging.info('Removing temporary file %s' % self.temp_path)
os.unlink(self.temp_path)
@@ -65,17 +64,17 @@ class MountableImage(object): # pragma: no cover
chatty=True)
try:
morphlib.fsutils.unmount(self.app.runcmd, mount_point)
- except BaseException, e:
+ except BaseException as e:
logging.info('Ignoring error when unmounting: %s' % str(e))
try:
morphlib.fsutils.undo_device_mapping(self.app.runcmd, path)
- except BaseException, e:
+ except BaseException as e:
logging.info(
'Ignoring error when undoing device mapping: %s' % str(e))
try:
os.rmdir(mount_point)
os.unlink(path)
- except BaseException, e:
+ except BaseException as e:
logging.info(
'Ignoring error when removing temporary files: %s' % str(e))