bitbake: bin/bitbake: Improve exception handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 May 2013 22:00:10 +0000 (23:00 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 May 2013 11:10:13 +0000 (12:10 +0100)
Due to the internal event processing, this excepting handler usually raises an
Empty error, masking the underlying failure. Ensure the original exception is
raised.

(Bitbake rev: 7d548568a55adfe84a976f2a549995e42da1afef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/bin/bitbake

index 0ca82e5..5b9294b 100755 (executable)
@@ -250,7 +250,8 @@ Default BBFILES are the .bb files in the current directory.""")
 
         server.addcooker(cooker)
         server.saveConnectionDetails()
-    except:
+    except Exception as e:
+        exc_info = sys.exc_info()
         while True:
             try:
                 import queue
@@ -262,7 +263,7 @@ Default BBFILES are the .bb files in the current directory.""")
                 break
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)
-        raise
+        raise exc_info[1], None, exc_info[2]
     server.detach()
 
     # Should no longer need to ever reference cooker