autobuild.py: Catch only true exceptions in except statement
authorAmitay Isaacs <amitay@gmail.com>
Tue, 24 Jan 2012 00:43:46 +0000 (11:43 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 24 Jan 2012 00:55:49 +0000 (11:55 +1100)
sys.exit(0) raises systemExit which is caught in empty except:
statement. This can change the exit status if except: condition is
supposed to exit with different status value.

script/autobuild.py

index d6ad082510e728062a443220d34c953569e1aab0..8ddd4b3e66b62044e58fbaf807e01a1d20f325fa 100755 (executable)
@@ -493,7 +493,7 @@ while True:
         run_cmd("rm -rf %s" % test_master)
         cleanup_list.append(test_master)
         run_cmd("git clone --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
-    except:
+    except Exception:
         cleanup()
         raise
 
@@ -503,7 +503,7 @@ while True:
                 rebase_tree(options.rebase)
             elif options.rebase_master:
                 rebase_tree(samba_master)
-        except:
+        except Exception:
             cleanup_list.append(gitroot + "/autobuild.pid")
             cleanup()
             email_failure(-1, 'rebase', 'rebase', 'rebase', 'rebase on master failed')
@@ -515,7 +515,7 @@ while True:
         if status != 0 or errstr != "retry":
             break
         cleanup()
-    except:
+    except Exception:
         cleanup()
         raise