Received: from eggs.gnu.org ([2001:4830:134:3::10]:47711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTZbP-0006fS-8s for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:25:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTZb8-0005Am-12 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:25:55 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56657 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTZb7-0005A2-L1 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:25:37 -0400 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Fri, 28 Mar 2014 17:25:30 +0100 Message-Id: <1396023932-17642-2-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1396023932-17642-1-git-send-email-benoit.canet@irqsave.net> References: <1396023932-17642-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH V3 1/3] test-qapi: Make test-qapi.py spit useful error messages. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Beno=C3=AEt=20Canet?= , wenchaoqemu@gmail.com, armbru@redhat.com, lcapitulino@redhat.com, anthony@codemonkey.ws, Benoit Canet In case of exception str(e) with e being the exception is more detailled. Signed-off-by: Benoit Canet Reviewed-by: Eric Blake --- tests/qapi-schema/test-qapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 1.7.10.4