From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR1sr-0005GT-6g for qemu-devel@nongnu.org; Fri, 21 Mar 2014 12:01:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR1sl-0000wZ-6Q for qemu-devel@nongnu.org; Fri, 21 Mar 2014 12:01:25 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56376 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR1sl-0000vl-1B for qemu-devel@nongnu.org; Fri, 21 Mar 2014 12:01:19 -0400 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Fri, 21 Mar 2014 17:01:12 +0100 Message-Id: <1395417673-17710-2-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1395417673-17710-1-git-send-email-benoit.canet@irqsave.net> References: <1395417673-17710-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH 1/2] 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 --- 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.8.3.2