[Openmp-commits] [openmp] [OpenMP] Fix comparison to True/False in openmp/**.py (PR #94041)

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


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

>From af3fbbd4b9544d6d5afa5183dec35e7dc49bf965 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima <e-kwsm at users.noreply.github.com>
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH] fix(openmp/**.py): fix comparison to True/False

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.py | 2 +-
 openmp/tools/archer/tests/lit.cfg      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/libompd/gdb-plugin/ompd/ompd.py b/openmp/libompd/gdb-plugin/ompd/ompd.py
index a404e621e77bb..8355865408a4e 100644
--- a/openmp/libompd/gdb-plugin/ompd/ompd.py
+++ b/openmp/libompd/gdb-plugin/ompd/ompd.py
@@ -50,7 +50,7 @@ def invoke(self, arg, from_tty):
                     "No ompd_dll_locations symbol in execution, make sure to have an OMPD enabled OpenMP runtime"
                 )
 
-            while gdb.parse_and_eval("(char**)ompd_dll_locations") == False:
+            while not gdb.parse_and_eval("(char**)ompd_dll_locations"):
                 gdb.execute("tbreak ompd_dll_locations_valid")
                 gdb.execute("continue")
 
diff --git a/openmp/tools/archer/tests/lit.cfg b/openmp/tools/archer/tests/lit.cfg
index 692cbfe97cf1e..f8fbcad752a4c 100644
--- a/openmp/tools/archer/tests/lit.cfg
+++ b/openmp/tools/archer/tests/lit.cfg
@@ -83,7 +83,7 @@ if config.operating_system == 'Darwin':
 if 'Linux' in config.operating_system:
     config.available_features.add("linux")
 
-if config.has_tsan == True:
+if config.has_tsan:
     config.available_features.add("tsan")
 
 # to run with icc INTEL_LICENSE_FILE must be set



More information about the Openmp-commits mailing list