From patchwork Fri Dec 21 20:53:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 10741045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D32B3924 for ; Fri, 21 Dec 2018 20:53:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B423E2841D for ; Fri, 21 Dec 2018 20:53:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2DFF2848B; Fri, 21 Dec 2018 20:53:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A82C2841D for ; Fri, 21 Dec 2018 20:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390647AbeLUUx6 (ORCPT ); Fri, 21 Dec 2018 15:53:58 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:36292 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730307AbeLUUx5 (ORCPT ); Fri, 21 Dec 2018 15:53:57 -0500 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 8D6BC5612AF for ; Fri, 21 Dec 2018 21:53:54 +0100 (CET) Received: by mail-ot1-f49.google.com with SMTP id 32so6273547ota.12 for ; Fri, 21 Dec 2018 12:53:54 -0800 (PST) X-Gm-Message-State: AJcUukd2VC02o2uFIDTRa0jfPRCx//hoTI5FEEhmYVrNhKUrBDLaw7O4 aDQHTFjqTNJBYPdLe7TRACQcvoqhN6Mmq1JVnI0= X-Google-Smtp-Source: ALg8bN6ZQosia6SSp2y0yltAKwQLJGqL9OQHkd547KQlWiev2Gu6DOAHtSSKB/THyBH44Ui3MYjQXyC5KCNDaO5tvYk= X-Received: by 2002:a9d:6c44:: with SMTP id g4mr2510233otq.368.1545425633522; Fri, 21 Dec 2018 12:53:53 -0800 (PST) MIME-Version: 1.0 From: Nicolas Iooss Date: Fri, 21 Dec 2018 21:53:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: [large PATCH on GitHub] python/sepolgen: upgrade ply to release 3.11 To: selinux@vger.kernel.org X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Fri Dec 21 21:53:55 2018 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I tried to send a large patch to the mailing list but it did not seem to work. Therefore I opened https://github.com/SELinuxProject/selinux/pull/117 and send now a smaller version below. Cheers, Nicolas ---------------- PLY (Python Lex-Yacc) 3.11 has been released in February 2018: - http://www.dabeaz.com/ply/index.html - https://github.com/dabeaz/ply/releases/tag/3.11 Copy lex.py and yacc.py from this new release. This fixes the following warning from "make test": python run-tests.py ../src/./sepolgen/lex.py:634: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if isinstance(t, collections.Callable): (Python 3.3 moved collections.Callable to collections.abc.Callable) Signed-off-by: Nicolas Iooss --- python/sepolgen/src/sepolgen/lex.py | 1298 ++++--- python/sepolgen/src/sepolgen/yacc.py | 4930 ++++++++++++++++---------- scripts/run-flake8 | 4 +- 3 files changed, 3872 insertions(+), 2360 deletions(-) diff --git a/python/sepolgen/src/sepolgen/lex.py b/python/sepolgen/src/sepolgen/lex.py index c13acef0507a..f95bcdbf1bb5 100644 --- a/python/sepolgen/src/sepolgen/lex.py +++ b/python/sepolgen/src/sepolgen/lex.py [Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ] diff --git a/python/sepolgen/src/sepolgen/yacc.py b/python/sepolgen/src/sepolgen/yacc.py index afef174849f2..88188a1e8ead 100644 --- a/python/sepolgen/src/sepolgen/yacc.py +++ b/python/sepolgen/src/sepolgen/yacc.py [Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ] -IGNORE_LIST="$IGNORE_LIST,F812" # list comprehension redefines 'f', in lex.py and yacc.py IGNORE_LIST="$IGNORE_LIST,F841" # local variable '...' is assigned to but never used @@ -75,4 +73,4 @@ IGNORE_LIST="$IGNORE_LIST,F405" # '...' may be undefined, or defined from star i IGNORE_LIST="$IGNORE_LIST,F811" # redefinition of unused ... -exec flake8 --max-line-length=120 --builtins='_,unicode,lextab,parsetab' --ignore=",$IGNORE_LIST" "$@" +exec flake8 --max-line-length=120 --builtins='_,basestring,unicode' --ignore=",$IGNORE_LIST" "$@" -- diff --git a/scripts/run-flake8 b/scripts/run-flake8 index 207edd20dd89..6ad029fa6852 100755 --- a/scripts/run-flake8 +++ b/scripts/run-flake8 @@ -17,10 +17,8 @@ IGNORE_LIST="$IGNORE_LIST,E101" # indentation contains mixed spaces and tabs IGNORE_LIST="$IGNORE_LIST,E711" # comparison to None should be 'if cond is not None:' IGNORE_LIST="$IGNORE_LIST,E712" # comparison to False should be 'if cond is False:' or 'if not cond:' IGNORE_LIST="$IGNORE_LIST,E722" # do not use bare 'except' -IGNORE_LIST="$IGNORE_LIST,E999" # TabError: inconsistent use of tabs and spaces in indentation IGNORE_LIST="$IGNORE_LIST,F401" # module imported but unused