From patchwork Tue Feb 9 11:37:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8260281 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 181A7BEEE5 for ; Tue, 9 Feb 2016 11:42:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76E282025A for ; Tue, 9 Feb 2016 11:42:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCFCF20254 for ; Tue, 9 Feb 2016 11:42:26 +0000 (UTC) Received: from localhost ([::1]:54586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6gc-0006mC-50 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 06:42:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6cT-0007om-8t for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT6cP-0002xA-Vb for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6cP-0002wx-Q8 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:05 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 764DA2620 for ; Tue, 9 Feb 2016 11:38:05 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19Bc3Qj027291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 9 Feb 2016 06:38:05 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4D9B5303D107; Tue, 9 Feb 2016 12:38:03 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2016 12:37:33 +0100 Message-Id: <1455017883-25867-2-git-send-email-armbru@redhat.com> In-Reply-To: <1455017883-25867-1-git-send-email-armbru@redhat.com> References: <1455017883-25867-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/31] qapi: Use Python 2.6 "except E as ..." syntax 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PEP 8 calls for it, because it's forward compatible with Python 3. Supported since Python 2.6, which we require (commit fec2103). Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Acked-by: Stefan Hajnoczi Message-Id: <1450425164-24969-2-git-send-email-armbru@redhat.com> --- scripts/qapi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 7dec611..645dcf1 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -167,7 +167,7 @@ class QAPISchemaParser(object): continue try: fobj = open(incl_abs_fname, 'r') - except IOError, e: + except IOError as e: raise QAPIExprError(expr_info, '%s: %s' % (e.strerror, include)) exprs_include = QAPISchemaParser(fobj, previously_included, @@ -1189,7 +1189,7 @@ class QAPISchema(object): self._predefining = False self._def_exprs() self.check() - except (QAPISchemaError, QAPIExprError), err: + except (QAPISchemaError, QAPIExprError) as err: print >>sys.stderr, err exit(1) @@ -1686,7 +1686,7 @@ def parse_command_line(extra_options="", extra_long_options=[]): "chp:o:" + extra_options, ["source", "header", "prefix=", "output-dir="] + extra_long_options) - except getopt.GetoptError, err: + except getopt.GetoptError as err: print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err)) sys.exit(1) @@ -1740,7 +1740,7 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, if output_dir: try: os.makedirs(output_dir) - except os.error, e: + except os.error as e: if e.errno != errno.EEXIST: raise