diff --git a/bob/devtools/scripts/rebuild.py b/bob/devtools/scripts/rebuild.py
index 18f192a9f958877e59ae9e92d2e0a8027260dc03..6b2c1aeb67230f93bc9b04869f058666d35f82b5 100644
--- a/bob/devtools/scripts/rebuild.py
+++ b/bob/devtools/scripts/rebuild.py
@@ -167,17 +167,20 @@ def rebuild(recipe_dir, python, condarc, config, append_file,
       # the build fails, depending on the reason.  This bit of code tries to
       # accomodate both code paths and decides if we should rebuild the package
       # or not
+      logger.info('Testing %s', src)
       try:
-        logger.info('Testing %s', src)
         result = conda_build.api.test(destpath, config=conda_config)
         should_build = not result
       except Exception as error:
         logger.exception(error)
-      finally:
-        if should_build:
-          logger.warn('Test for %s: FAILED. Building...', src)
-        else:
-          logger.info('Test for %s: SUCCESS (package is up-to-date)', src)
+      except:
+        logger.error('conda_build.api.test() threw an unknown exception - ' \
+            'looks like bad programming, but not on our side this time...')
+
+      if should_build:
+        logger.warn('Test for %s: FAILED. Building...', src)
+      else:
+        logger.info('Test for %s: SUCCESS (package is up-to-date)', src)
 
 
     if should_build:  #something wrong happened, run a full build