summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorDirk Mueller <dirk@dmllr.de>2013-05-18 00:18:18 +0200
committerDirk Mueller <dirk@dmllr.de>2013-06-01 09:57:31 +0200
commitbf68a9592db4c90bc9421ce49c7c0766966d6e7e (patch)
tree0a02a49d60348af8cb74d9be59c7a961666b7f01 /nova/utils.py
parent5a510518d9e3097730466cfbf4ff25495c4a0302 (diff)
downloadnova-bf68a9592db4c90bc9421ce49c7c0766966d6e7e.tar.gz
nova-bf68a9592db4c90bc9421ce49c7c0766966d6e7e.tar.xz
nova-bf68a9592db4c90bc9421ce49c7c0766966d6e7e.zip
Improve Python 3.x compatibility
Mechanical translation of the deprecated except x,y: construct with except x as y: The latter works with any Python >= 2.6. Add Hacking check. Change-Id: I845829d97d379c1cd9b3a77e7e5786586f263b64
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 97551e8eb..de843dff4 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -927,7 +927,7 @@ def tempdir(**kwargs):
finally:
try:
shutil.rmtree(tmpdir)
- except OSError, e:
+ except OSError as e:
LOG.error(_('Could not remove tmpdir: %s'), str(e))
@@ -1007,7 +1007,7 @@ def last_bytes(file_like_object, num):
try:
file_like_object.seek(-num, os.SEEK_END)
- except IOError, e:
+ except IOError as e:
if e.errno == 22:
file_like_object.seek(0, os.SEEK_SET)
else:
@@ -1074,7 +1074,7 @@ class ExceptionHelper(object):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
- except rpc_common.ClientException, e:
+ except rpc_common.ClientException as e:
raise (e._exc_info[1], None, e._exc_info[2])
return wrapper