From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 246C43858287; Fri, 23 Feb 2024 11:50:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 246C43858287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708689046; bh=Cyy3sfhqZfgTYGZF+kKqgBvyJL7OGe73S0I1BRljfJ4=; h=From:To:Subject:Date:From; b=YfAD0qBPPApGNrL/f6w+UDGIz0wlilc3qOwuaeyTY/ot1inCtQc0WdU6oAQK5vH89 Gb2XMd+NfyaZsnypkHL2bqZYY156/JwL7YzMBTqAEAAj0dGrJvtA+qP1iZSn9Walg5 K+fve4sj/oqeW4pewyUG8BceR8ommYImcm5TtRd4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] treewide: python-scripts: use `is None` for none-equality X-Act-Checkin: glibc X-Git-Author: Konstantin Kharlamov X-Git-Refname: refs/heads/master X-Git-Oldrev: 1e9a550ba41a5453c6578bb748fe2223a87e3024 X-Git-Newrev: fe00366b63c5cf1a84864647ec4e15721c04ebcf Message-Id: <20240223115046.246C43858287@sourceware.org> Date: Fri, 23 Feb 2024 11:50:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fe00366b63c5cf1a84864647ec4e15721c04ebcf commit fe00366b63c5cf1a84864647ec4e15721c04ebcf Author: Konstantin Kharlamov Date: Sun Feb 18 23:02:34 2024 +0300 treewide: python-scripts: use `is None` for none-equality Testing for `None`-ness with `==` operator is frowned upon and causes warnings in at least "LGTM" python linter. Fix that. Signed-off-by: Konstantin Kharlamov Reviewed-by: Adhemerval Zanella Diff: --- 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 216e4640ef..d3a7f65899 100755 --- a/math/gen-tgmath-tests.py +++ b/math/gen-tgmath-tests.py @@ -414,7 +414,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 # For narrowing macros, compute narrow_args, the list of # argument types for which there is an actual corresponding @@ -462,7 +462,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 @@ -544,7 +544,7 @@ class Tests(object): all_conds.append(can_comb) if narrowing: all_conds.append(narrow_cond) - 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 41d1a76c65..fc9d39d70c 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)