diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2019-05-23 14:07:49 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-06-20 23:40:17 +0000 |
commit | fb12a252613205dd0ebcfc8716847aed510e07cb (patch) | |
tree | 2e4744ba73341ef620d21b62e1fc135f9f6e41e4 /script | |
parent | ae90e5263bd65042b067ab900c83bf310f977dbd (diff) | |
download | samba-fb12a252613205dd0ebcfc8716847aed510e07cb.tar.gz |
script/autobuild.py: avoid nested try except block
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script')
-rwxr-xr-x | script/autobuild.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/script/autobuild.py b/script/autobuild.py index 0a4d7ada21d..0d5f304f3f7 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -1173,17 +1173,18 @@ while True: raise try: - try: - if options.rebase is not None: - rebase_tree(options.rebase, rebase_branch=options.branch) - except Exception: - cleanup_list.append(gitroot + "/autobuild.pid") - cleanup() - elapsed_time = time.time() - start_time - email_failure(-1, 'rebase', 'rebase', 'rebase', - 'rebase on %s failed' % options.branch, - elapsed_time, log_base=options.log_base) - sys.exit(1) + if options.rebase is not None: + rebase_tree(options.rebase, rebase_branch=options.branch) + except Exception: + cleanup_list.append(gitroot + "/autobuild.pid") + cleanup() + elapsed_time = time.time() - start_time + email_failure(-1, 'rebase', 'rebase', 'rebase', + 'rebase on %s failed' % options.branch, + elapsed_time, log_base=options.log_base) + sys.exit(1) + + try: blist = buildlist(args, options.rebase, rebase_branch=options.branch) if options.tail: blist.start_tail() |