selftest and autrobuild: convert 'except X, e' to 'except X as e'
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 13 Feb 2018 21:35:53 +0000 (10:35 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Feb 2018 23:18:30 +0000 (00:18 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
script/autobuild.py
selftest/subunithelper.py

index 40bace5..ebe49bb 100755 (executable)
@@ -747,7 +747,7 @@ top_commit_msg = run_cmd("git log -1", dir=gitroot, output=True)
 
 try:
     os.makedirs(testbase)
-except Exception, reason:
+except Exception as reason:
     raise Exception("Unable to create %s : %s" % (testbase, reason))
 cleanup_list.append(testbase)
 
index fab7d6f..028f5df 100644 (file)
@@ -64,7 +64,7 @@ def parse_results(msg_ops, statistics, fh):
             msg_ops.control_msg(l)
             try:
                 dt = iso8601.parse_date(arg.rstrip("\n"))
-            except TypeError, e:
+            except TypeError as e:
                 print "Unable to parse time line: %s" % arg.rstrip("\n")
             else:
                 msg_ops.time(dt)