[polly] fix(polly/**.py): fix comparison to True/False (PR #94042)

Eisuke Kawashima via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 06:38:35 PST 2024


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

>From 6d0298a288198cd5e72de13998762305252e115a 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(polly/**.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.
---
 polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
index 1b5a38ce829b39..d7cc2b452efc6f 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
@@ -54,7 +54,7 @@ def run_test(test, line, name, gmp_test_so, imath_test_so, *args):
   if childpid == 0:
     eq = test(line, name, gmp_test_so, imath_test_so, *args)
     if fork:
-      sys.exit(eq != True)
+      sys.exit(not eq)
     else:
       return eq
   else:



More information about the llvm-commits mailing list