diff mbox

[1/2] test-qapi: Make test-qapi.py spit useful error messages.

Message ID 1395417673-17710-2-git-send-email-benoit.canet@irqsave.net
State New
Headers show

Commit Message

Benoît Canet March 21, 2014, 4:01 p.m. UTC
In case of exception str(e) with e being the exception is more detailled.

Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 tests/qapi-schema/test-qapi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Blake March 27, 2014, 2:47 a.m. UTC | #1
On 03/21/2014 10:01 AM, Benoît Canet wrote:
> In case of exception str(e) with e being the exception is more detailled.
> 
> Signed-off-by: Benoit Canet <benoit@irqsave.net>
> ---
>  tests/qapi-schema/test-qapi.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index b3d1e1d..ac6da13 100644
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -18,8 +18,8 @@  try:
     exprs = parse_schema(sys.stdin)
 except SystemExit:
     raise
-except:
-    print >>sys.stderr, "Crashed:", sys.exc_info()[0]
+except Exception, e:
+    print >>sys.stderr, "Crashed:", str(e)
     exit(1)
 
 pprint(exprs)