commit: 08762b404c86856d4794def0e3b4a1d68a1c424d
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Wed May 14 00:41:21 2014 +0000
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Wed May 14 00:41:21 2014 +0000
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=08762b40
Changes "Exception, error" to "Exception as error", part 2.
These compatibility changes were overlooked in the "overlay/"
directory and are applied in this commit.
---
layman/overlays/overlay.py | 2 +-
layman/overlays/source.py | 2 +-
layman/overlays/tar.py | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 65c148b..0c2d042 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -414,7 +414,7 @@ class Overlay(object):
# Worked, throw other sources away
self.sources = [s]
break
- except Exception, error:
+ except Exception as error:
self.output.warn(str(error), 4)
first_s = False
return res
diff --git a/layman/overlays/source.py b/layman/overlays/source.py
index 2b79f2c..69c59bb 100644
--- a/layman/overlays/source.py
+++ b/layman/overlays/source.py
@@ -177,7 +177,7 @@ class OverlaySource(object):
self.output.warn("Checking for cleanup actions to perform", 4)
self.cleanup()
result = 1
- except Exception, err:
+ except Exception as err:
self.output.error(
'Unknown exception running command: %s' % command_repr)
self.output.error('Original error was: %s' % str(err))
diff --git a/layman/overlays/tar.py b/layman/overlays/tar.py
index c6f2443..e57096d 100644
--- a/layman/overlays/tar.py
+++ b/layman/overlays/tar.py
@@ -111,7 +111,7 @@ class TarOverlay(OverlaySource):
try:
tar = urllib2.urlopen(tar_url).read()
- except Exception, error:
+ except Exception as error:
raise Exception('Failed to fetch the tar package from: '
+ self.src + '\nError was:' + str(error))
@@ -121,7 +121,7 @@ class TarOverlay(OverlaySource):
out_file = open(pkg, 'w+b')
out_file.write(tar)
out_file.close()
- except Exception, error:
+ except Exception as error:
raise Exception('Failed to store tar package in '
+ pkg + '\nError was:' + str(error))
@@ -140,7 +140,7 @@ class TarOverlay(OverlaySource):
try:
self.output.info('Deleting directory "%s"' % folder, 2)
shutil.rmtree(folder)
- except Exception, error:
+ except Exception as error:
raise Exception('Failed to remove unnecessary tar structure "'
+ folder + '"\nError was:' + str(error))
@@ -149,7 +149,7 @@ class TarOverlay(OverlaySource):
try:
result = self._extract(base=base, tar_url=self.src,
dest_dir=temp_path)
- except Exception, error:
+ except Exception as error:
try_to_wipe(temp_path)
raise error
@@ -165,7 +165,7 @@ class TarOverlay(OverlaySource):
try:
os.rename(source, final_path)
- except Exception, error:
+ except Exception as error:
raise Exception('Failed to rename tar subdirectory ' +
source + ' to ' + final_path +
'\nError was:' + str(error))