From: Douglas Bagnall Date: Tue, 13 Feb 2018 21:35:53 +0000 (+1300) Subject: selftest and autrobuild: convert 'except X, e' to 'except X as e' X-Git-Tag: tevent-0.9.36~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16e173ad2e52ed1140fd43cabdeec0bc4553f6d2;p=thirdparty%2Fsamba.git selftest and autrobuild: convert 'except X, e' to 'except X as e' Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/script/autobuild.py b/script/autobuild.py index 40bace59ccb..ebe49bb75cb 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -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) diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py index fab7d6f0b41..028f5dff77e 100644 --- a/selftest/subunithelper.py +++ b/selftest/subunithelper.py @@ -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)