From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCJI-0001Gi-Fd for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCJD-0004Tf-Kp for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:33:40 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56579 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCJD-0004Sa-FV for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:33:35 -0400 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Thu, 27 Mar 2014 16:33:17 +0100 Message-Id: <1395934399-18769-2-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1395934399-18769-1-git-send-email-benoit.canet@irqsave.net> References: <1395934399-18769-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH V2 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