From patchwork Thu Mar 27 15:33:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 334364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D621F14009C for ; Fri, 28 Mar 2014 02:34:11 +1100 (EST) Received: from localhost ([::1]:54345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCJl-0001IH-Rs for incoming@patchwork.ozlabs.org; Thu, 27 Mar 2014 11:34:09 -0400 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 Received: from localhost.localdomain (laure.irqsave.net [192.168.77.2]) by paradis.irqsave.net (Postfix) with ESMTP id ED4E28631B; Thu, 27 Mar 2014 17:49:21 +0100 (CET) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= To: qemu-devel@nongnu.org Date: Thu, 27 Mar 2014 16:33:17 +0100 Message-Id: <1395934399-18769-2-git-send-email-benoit.canet@irqsave.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395934399-18769-1-git-send-email-benoit.canet@irqsave.net> References: <1395934399-18769-1-git-send-email-benoit.canet@irqsave.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 80.12.84.125 Cc: =?UTF-8?q?Beno=C3=AEt=20Canet?= , wenchaoqemu@gmail.com, armbru@redhat.com, lcapitulino@redhat.com, anthony@codemonkey.ws, Benoit Canet Subject: [Qemu-devel] [PATCH V2 1/3] test-qapi: Make test-qapi.py spit useful error messages. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)