server_job: Use new style except statements
BUG=chromium:682417
TEST=None
Change-Id: I47465b5163db7d74f7e0afce4ed801bd7e4271aa
Reviewed-on: https://chromium-review.googlesource.com/437607
Commit-Ready: Prathmesh Prabhu <[email protected]>
Tested-by: Prathmesh Prabhu <[email protected]>
Reviewed-by: Prathmesh Prabhu <[email protected]>
Reviewed-by: Richard Barnette <[email protected]>
diff --git a/server/server_job.py b/server/server_job.py
index 8e14e51..1151a35 100644
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -803,7 +803,7 @@
# If no device error occured, no need to collect crashinfo.
collect_crashinfo = self.failed_with_device_error
- except Exception, e:
+ except Exception as e:
try:
logging.exception(
'Exception escaped control file, job aborting:')
@@ -819,7 +819,7 @@
# Clean up temp directory used for copies of the control files
try:
shutil.rmtree(temp_control_file_dir)
- except Exception, e:
+ except Exception as e:
logging.warning('Could not remove temp directory %s: %s',
temp_control_file_dir, e)
@@ -862,10 +862,10 @@
def group_func():
try:
test.runtest(self, url, tag, args, dargs)
- except error.TestBaseException, e:
+ except error.TestBaseException as e:
self.record(e.exit_status, subdir, testname, str(e))
raise
- except Exception, e:
+ except Exception as e:
info = str(e) + "\n" + traceback.format_exc()
self.record('FAIL', subdir, testname, info)
raise
@@ -889,10 +889,10 @@
try:
self.record('START', subdir, name)
result = function(*args, **dargs)
- except error.TestBaseException, e:
+ except error.TestBaseException as e:
self.record("END %s" % e.exit_status, subdir, name)
exc_info = sys.exc_info()
- except Exception, e:
+ except Exception as e:
err_msg = str(e) + '\n'
err_msg += traceback.format_exc()
self.record('END ABORT', subdir, name, err_msg)
@@ -936,7 +936,7 @@
try:
self.record('START', None, op)
op_func()
- except Exception, e:
+ except Exception as e:
err_msg = str(e) + '\n' + traceback.format_exc()
self.record('END FAIL', None, op, err_msg)
raise