From patchwork Sun Mar 31 17:44:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Kharlamov X-Patchwork-Id: 32106 Received: (qmail 78262 invoked by alias); 31 Mar 2019 17:44:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 78165 invoked by uid 89); 31 Mar 2019 17:44:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS, URIBL_BLOCKED autolearn=ham version=3.3.1 spammy=H*F:D*ru, HContent-Transfer-Encoding:8bit X-HELO: forward101p.mail.yandex.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554054273; bh=sejjD+vzI3rHT3wde8nR7vswR6DD5uSmPm5WGtQVOVE=; h=In-Reply-To:Subject:To:From:References:Date:Message-Id; b=YdVTSGZG1R6UxcsY8NEAK12sZJ+oQRpSINz4hiccIQR1HB3AXYU32/dErLdvPSi3Q r2zRvA8+AD7WyQ4+I0jkSJEj8TKGZW6XJLJZiHmOJeNsAs9Jr3W5D5gOaRo98L0Zby 0ZUeBDA+ywNS1z7Z1qlo6d6x6LHNEFDvDh9Zj7oY= Authentication-Results: mxback4j.mail.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Kharlamov To: libc-alpha@sourceware.org Subject: [PATCH v2 3/3] python scripts: don't use "==" to compare to None Date: Sun, 31 Mar 2019 20:44:20 +0300 Message-Id: <20190331174420.30823-4-Hi-Angel@yandex.ru> In-Reply-To: <20190331174420.30823-1-Hi-Angel@yandex.ru> References: <20190331174420.30823-1-Hi-Angel@yandex.ru> MIME-Version: 1.0 Fixes 4 LGTM warnings "Testing for None should use the 'is' operator." Reviewed-by: Joseph Myers Signed-off-by: Konstantin Kharlamov --- math/gen-tgmath-tests.py | 6 +++--- nptl/nptl-printers.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py index 724a437b69..b6b068c6b3 100755 --- a/math/gen-tgmath-tests.py +++ b/math/gen-tgmath-tests.py @@ -385,7 +385,7 @@ class Tests(object): elif ret == 'g' or 'g' in args: # Real and complex. have_complex = True - if complex_func == None: + if complex_func is None: complex_func = 'c%s' % func types = [ret] + args for t in types: @@ -396,7 +396,7 @@ class Tests(object): continue if t.complex and not have_complex: continue - if func == None and not t.complex: + if func is None and not t.complex: continue if ret == 's' and t.name.startswith('_Float'): continue @@ -449,7 +449,7 @@ class Tests(object): can_comb = Type.can_combine_types(this_args) all_conds = [t.condition for t in this_args] all_conds.append(can_comb) - any_complex = func == None + any_complex = func is None for t in this_args: if t.complex: any_complex = True diff --git a/nptl/nptl-printers.py b/nptl/nptl-printers.py index 493dfa0889..71962b1103 100644 --- a/nptl/nptl-printers.py +++ b/nptl/nptl-printers.py @@ -587,7 +587,7 @@ def register(objfile): printer.add_printer('pthread_rwlockattr_t', r'^pthread_rwlockattr_t$', RWLockAttributesPrinter) - if objfile == None: + if objfile is None: objfile = gdb gdb.printing.register_pretty_printer(objfile, printer)