[Openmp-commits] [openmp] cf00bb0 - [OpenMP] Fix comparison to None in openmp/**.py (#94020)
via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jul 16 07:18:19 PDT 2024
Author: Eisuke Kawashima
Date: 2024-07-16T16:18:16+02:00
New Revision: cf00bb007428124a0d5af596300407ec11580fb2
URL: https://github.com/llvm/llvm-project/commit/cf00bb007428124a0d5af596300407ec11580fb2
DIFF: https://github.com/llvm/llvm-project/commit/cf00bb007428124a0d5af596300407ec11580fb2.diff
LOG: [OpenMP] Fix comparison to None in openmp/**.py (#94020)
from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):
> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.
Co-authored-by: Eisuke Kawashima <e-kwsm at users.noreply.github.com>
Added:
Modified:
openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py
Removed:
################################################################################
diff --git a/openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py b/openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py
index ada09d75579f0..40eb3305f2e24 100644
--- a/openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py
+++ b/openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py
@@ -84,7 +84,7 @@ def _thread_context(*args):
m = re.search(r"(0x[a-fA-F0-9]+)", line)
elif lwp:
m = re.search(r"\([^)]*?(\d+)[^)]*?\)", line)
- if m == None:
+ if m is None:
continue
pid = int(m.group(1), 0)
if pid == thread_id:
More information about the Openmp-commits
mailing list