summaryrefslogtreecommitdiffstats
path: root/layman/overlays/tar.py
diff options
context:
space:
mode:
authordol-sen <brian.dolbec@gmail.com>2011-08-09 17:47:00 -0700
committerdol-sen <brian.dolbec@gmail.com>2011-08-09 17:47:00 -0700
commit779c56e34676bcf113dea93c748eeec5f214952f (patch)
treed90d3a1ec4aa73162acc4b9cdc21b3970d68155c /layman/overlays/tar.py
parente9742ba56ea23e9d61505a41e9a5cdda60bbfc99 (diff)
downloadlayman-779c56e34676bcf113dea93c748eeec5f214952f.tar.gz
layman-779c56e34676bcf113dea93c748eeec5f214952f.tar.bz2
layman-779c56e34676bcf113dea93c748eeec5f214952f.zip
revert using "as" in exceptions. enable using the "with" statement in py-2.5.
fix run_command( ,*arg, )
Diffstat (limited to 'layman/overlays/tar.py')
-rw-r--r--layman/overlays/tar.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/layman/overlays/tar.py b/layman/overlays/tar.py
index 7be2ed2..f061ad6 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 as error:
+ except Exception, 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')
out_file.write(tar)
out_file.close()
- except Exception as error:
+ except Exception, 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 as error:
+ except Exception, 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 as error:
+ except Exception, error:
try_to_wipe(temp_path)
raise error
@@ -165,7 +165,7 @@ class TarOverlay(OverlaySource):
try:
os.rename(source, final_path)
- except Exception as error:
+ except Exception, error:
raise Exception('Failed to rename tar subdirectory ' +
source + ' to ' + final_path +
'\nError was:' + str(error))