Commit 407f2bea authored by Jérome Perrin's avatar Jérome Perrin

py3: 2to3 -j 20 --write --nobackups --no-diffs --fix=except master

parent 883a448f
...@@ -114,13 +114,13 @@ try: ...@@ -114,13 +114,13 @@ try:
instance_tree.activate(activity="SQLQueue", tag=tag, instance_tree.activate(activity="SQLQueue", tag=tag,
after_tag="allocate_%s" % compute_partition_url).getId() after_tag="allocate_%s" % compute_partition_url).getId()
except ValueError, e: except ValueError as e:
# It was not possible to find free Compute Partition # It was not possible to find free Compute Partition
markHistory(software_instance, 'Allocation failed: no free Compute Partition %s' % e) markHistory(software_instance, 'Allocation failed: no free Compute Partition %s' % e)
except Unauthorized, e: except Unauthorized as e:
# user has bad balance # user has bad balance
markHistory(software_instance, 'Allocation failed: %s' % e) markHistory(software_instance, 'Allocation failed: %s' % e)
except NotImplementedError, e: except NotImplementedError as e:
# user has bad balance # user has bad balance
markHistory(software_instance, 'Allocation failed: %s' % e) markHistory(software_instance, 'Allocation failed: %s' % e)
else: else:
......
...@@ -92,11 +92,11 @@ def convertToREST(function): ...@@ -92,11 +92,11 @@ def convertToREST(function):
""" """
try: try:
retval = function(self, *args, **kwd) retval = function(self, *args, **kwd)
except (ValueError, AttributeError), log: except (ValueError, AttributeError) as log:
LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:', LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:',
error=True) error=True)
raise NotFound(log) raise NotFound(log)
except SoftwareInstanceNotReady, log: except SoftwareInstanceNotReady as log:
self.REQUEST.response.setStatus(408) self.REQUEST.response.setStatus(408)
self.REQUEST.response.setHeader('Cache-Control', 'private') self.REQUEST.response.setHeader('Cache-Control', 'private')
return self.REQUEST.response return self.REQUEST.response
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment