[Openmp-commits] [openmp] [OpenMP] Fix comparison to None in openmp/**.py (PR #94020)

Eisuke Kawashima via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 15 22:36:09 PDT 2024


https://github.com/e-kwsm updated https://github.com/llvm/llvm-project/pull/94020

>From 7daac1ab63369dbbe78eec1f84817dcff0b85aa9 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima <e-kwsm at users.noreply.github.com>
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH] fix(openmp/**.py): fix comparison to None

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.
---
 openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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