From patchwork Fri Jan 12 22:15:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 860217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJHBj2qMwz9s83 for ; Sat, 13 Jan 2018 09:15:57 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 99792F97; Fri, 12 Jan 2018 22:15:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8D001F84 for ; Fri, 12 Jan 2018 22:15:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D9B9C14D for ; Fri, 12 Jan 2018 22:15:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45261780F0; Fri, 12 Jan 2018 22:15:52 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7BDB4A6; Fri, 12 Jan 2018 22:15:51 +0000 (UTC) From: Aaron Conole To: dev@openvswitch.org Date: Fri, 12 Jan 2018 17:15:50 -0500 Message-Id: <20180112221550.14274-1-aconole@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 12 Jan 2018 22:15:52 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2] flake8: Ignore bare except violations X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Newer versions of flake8 (3.5.0, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) add an error code for 'bare exception'. The OvS codebase does use bare exceptions in places, especially when the specific exception isn't important (ie: the program will be terminating, so the specific exception isn't important). Without this change, the following error messages appear: utilities/checkpatch.py:476:5: E722 do not use bare except' utilities/checkpatch.py:514:5: E722 do not use bare except' utilities/ovs-dev.py:189:5: E722 do not use bare except' utilities/ovs-dev.py:192:9: E722 do not use bare except' utilities/ovs-dev.py:197:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:360:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:434:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:470:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:609:9: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:679:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:712:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:744:9: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:751:9: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:825:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1006:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1041:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1079:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1202:5: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1247:9: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1257:13: E722 do not use bare except' utilities/bugtool/ovs-bugtool.in:1328:9: E722 do not use bare except' tests/test-daemon.py:60:5: E722 do not use bare except' tests/test-l7.py:23:1: E722 do not use bare except' tests/test-unixctl.py:96:5: E722 do not use bare except' xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync:404:5: E722 do not use bare except' python/ovs/fcntl_win.py:39:9: E722 do not use bare except' python/ovs/poller.py:38:1: E722 do not use bare except' python/ovs/socket_util.py:151:13: E722 do not use bare except' python/ovs/stream.py:169:17: E722 do not use bare except' python/ovs/stream.py:578:17: E722 do not use bare except' python/ovs/timeval.py:51:1: E722 do not use bare except' python/ovstest/util.py:52:5: E722 do not use bare except' vtep/ovs-vtep:767:5: E722 do not use bare except' Signed-off-by: Aaron Conole --- v1->v2: Include more information about the change. Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index d7cfdcd52..2c655df2e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -359,7 +359,7 @@ endif if HAVE_FLAKE8 ALL_LOCAL += flake8-check -# http://flake8.readthedocs.org/en/latest/warnings.html +# http://flake8.readthedocs.org/en/latest/user/error-codes.html # All warnings explicitly selected or ignored should be listed below. # # E***, W*** -- warnings from pep8 @@ -371,6 +371,7 @@ ALL_LOCAL += flake8-check # E128 continuation line under-indented for visual indent # E129 visually indented line with same indent as next logical line # E131 continuation line unaligned for hanging indent +# E722 do not use bare except, specify exception instead # W503 line break before binary operator # F*** -- warnings native to flake8 # F811 redefinition of unused from line (only from flake8 v2.0) @@ -381,7 +382,7 @@ ALL_LOCAL += flake8-check # H233 Python 3.x incompatible use of print operator # H238 old style class declaration, use new style (inherit from `object`) FLAKE8_SELECT = H231,H232,H233,H238 -FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H,I +FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E722,W503,F811,D,H,I flake8-check: $(FLAKE8_PYFILES) $(FLAKE8_WERROR)$(AM_V_GEN) \ src='$^' && \