diff options
author | Javier Jardón <jjardon@gnome.org> | 2015-03-13 13:02:24 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2015-03-16 16:34:55 +0000 |
commit | aab6f2b5d3621d5760145d133a72495ef2ac1f25 (patch) | |
tree | 561f7ca9b2ce8fd78fbf425d7b7fc3b7e12adcd5 /morphlib/mountableimage.py | |
parent | db23e8e6406f98722d2d18bf61b8e85cd99415eb (diff) | |
download | morph-aab6f2b5d3621d5760145d133a72495ef2ac1f25.tar.gz |
Use python3 compatible notation for catching exceptions
Change-Id: Ibda7a938cd16e35517a531140f39ef4664d85c72
Diffstat (limited to 'morphlib/mountableimage.py')
-rw-r--r-- | morphlib/mountableimage.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/morphlib/mountableimage.py b/morphlib/mountableimage.py index ecca58f3..dcc496e7 100644 --- a/morphlib/mountableimage.py +++ b/morphlib/mountableimage.py @@ -45,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) @@ -64,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)) |