Skip to content

Commit 47fc139

Browse files
committed
fixup! fix(python): fix comparison to True/False
1 parent cdc6e7c commit 47fc139

File tree

16 files changed

+22
-22
lines changed

16 files changed

+22
-22
lines changed

clang/tools/scan-build/bin/set-xcode-analyzer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def main():
107107
foundSpec = True
108108
ModifySpec(x, isBuiltinAnalyzer, path)
109109

110-
if foundSpec is False:
110+
if not foundSpec:
111111
print "(-) No compiler configuration file was found. Xcode's analyzer has not been updated."
112112

113113
if __name__ == '__main__':

clang/utils/check_cfc/check_cfc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def get_output_file(args):
156156
elif arg.startswith("-o"):
157157
# Specified conjoined with -o
158158
return arg[2:]
159-
assert grabnext is False
159+
assert not grabnext
160160

161161
return None
162162

@@ -182,7 +182,7 @@ def replace_output_file(args, new_name):
182182
if replaceidx is None:
183183
raise Exception
184184
replacement = new_name
185-
if attached is True:
185+
if attached:
186186
replacement = "-o" + new_name
187187
args[replaceidx] = replacement
188188
return args

lldb/examples/python/crashlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
166166
this_thread_crashed = self.app_specific_backtrace
167167
if not this_thread_crashed:
168168
this_thread_crashed = self.did_crash()
169-
if options.crashed_only and this_thread_crashed is False:
169+
if options.crashed_only and not this_thread_crashed:
170170
return
171171

172172
print("%s" % self)

lldb/examples/python/disasm-stress-test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
9595

9696
debugger = lldb.SBDebugger.Create()
9797

98-
if debugger.IsValid() is False:
98+
if not debugger.IsValid():
9999
print("Couldn't create an SBDebugger")
100100
sys.exit(-1)
101101

102102
target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
103103

104-
if target.IsValid() is False:
104+
if not target.IsValid():
105105
print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
106106
sys.exit(-1)
107107

lldb/examples/summaries/cocoa/CFString.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
253253
elif (
254254
self.inline
255255
and self.explicit
256-
and self.unicode is False
257-
and self.special is False
258-
and self.mutable is False
256+
and not self.unicode
257+
and not self.special
258+
and not self.mutable
259259
):
260260
return self.handle_inline_explicit()
261261
elif self.unicode:

lldb/examples/summaries/pysummary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def pyobj_summary(value, unused):
5-
if value is None or value.IsValid() is False or value.GetValueAsUnsigned(0) == 0:
5+
if value is None or not value.IsValid() or value.GetValueAsUnsigned(0) == 0:
66
return "<invalid>"
77
refcnt = value.GetChildMemberWithName("ob_refcnt")
88
expr = "(char*)PyString_AsString( (PyObject*)PyObject_Str( (PyObject*)0x%x) )" % (

lldb/examples/synthetic/bitfield/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_child_at_index(self, index):
5151
return None
5252
if index > self.num_children():
5353
return None
54-
if self.valobj.IsValid() is False:
54+
if not self.valobj.IsValid():
5555
return None
5656
if index == 0:
5757
return self.valobj.GetChildMemberWithName("value")

lldb/test/API/commands/command/script/welcome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def print_wait_impl(debugger, args, result, dict):
4545
def check_for_synchro(debugger, args, result, dict):
4646
if debugger.GetAsync():
4747
print("I am running async", file=result)
48-
if debugger.GetAsync() is False:
48+
if not debugger.GetAsync():
4949
print("I am running sync", file=result)
5050

5151

lldb/test/API/commands/expression/call-throws/TestCallThatThrows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def call_function(self):
6161

6262
value = frame.EvaluateExpression("[my_class callMeIThrow]", options)
6363

64-
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
64+
self.assertTrue(value.IsValid() and not value.GetError().Success())
6565
self.check_after_call()
6666

6767
# Now set the ObjC language breakpoint and make sure that doesn't
@@ -76,7 +76,7 @@ def call_function(self):
7676

7777
value = frame.EvaluateExpression("[my_class callMeIThrow]", options)
7878

79-
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
79+
self.assertTrue(value.IsValid() and not value.GetError().Success())
8080
self.check_after_call()
8181

8282
# Now turn off exception trapping, and call a function that catches the exceptions,
@@ -95,5 +95,5 @@ def call_function(self):
9595
options.SetUnwindOnError(False)
9696
value = frame.EvaluateExpression("[my_class callMeIThrow]", options)
9797

98-
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
98+
self.assertTrue(value.IsValid() and not value.GetError().Success())
9999
self.check_after_call()

lldb/test/API/functionalities/disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def disassemble_check_for_hi_and_foo(self, target, func, binaryname):
5757
found_hi_string = True
5858
if "foo" in i.GetComment(target):
5959
found_foo = True
60-
if found_hi_string is False or found_foo is False:
60+
if not found_hi_string or not found_foo:
6161
print(
6262
'Did not find "HI" string or "foo" in disassembly symbolication in %s'
6363
% binaryname

lldb/test/API/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def qXferRead(self, obj, annex, offset, length):
6161
wp_opts = lldb.SBWatchpointOptions()
6262
wp_opts.SetWatchpointTypeWrite(lldb.eWatchpointWriteTypeOnModify)
6363
wp = target.WatchpointCreateByAddress(0x100, 8, wp_opts, err)
64-
if self.TraceOn() and (err.Fail() or wp.IsValid is False):
64+
if self.TraceOn() and (err.Fail() or not wp.IsValid):
6565
strm = lldb.SBStream()
6666
err.GetDescription(strm)
6767
print("watchpoint failed: %s" % strm.GetData())

lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def breakpoint_set_and_remove_work(self, want_hardware):
953953
z_packet_type = 0
954954

955955
# If hardware breakpoint is requested set packet type to Z1
956-
if want_hardware is True:
956+
if want_hardware:
957957
z_packet_type = 1
958958

959959
self.reset_test_sequence()

llvm/utils/indirect_calls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def look_for_indirect(file):
3131

3232
function = ""
3333
for line in stdout.splitlines():
34-
if line.startswith(" ") is False:
34+
if not line.startswith(" "):
3535
function = line
3636
result = re.search("(call|jmp).*\*", line)
3737
if result != None:

openmp/libompd/gdb-plugin/ompd/ompd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def invoke(self, arg, from_tty):
5050
"No ompd_dll_locations symbol in execution, make sure to have an OMPD enabled OpenMP runtime"
5151
)
5252

53-
while gdb.parse_and_eval("(char**)ompd_dll_locations") is False:
53+
while not gdb.parse_and_eval("(char**)ompd_dll_locations"):
5454
gdb.execute("tbreak ompd_dll_locations_valid")
5555
gdb.execute("continue")
5656

openmp/tools/archer/tests/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if config.operating_system == 'Darwin':
8383
if 'Linux' in config.operating_system:
8484
config.available_features.add("linux")
8585

86-
if config.has_tsan is True:
86+
if config.has_tsan:
8787
config.available_features.add("tsan")
8888

8989
# to run with icc INTEL_LICENSE_FILE must be set

polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def run_test(test, line, name, gmp_test_so, imath_test_so, *args):
5454
if childpid == 0:
5555
eq = test(line, name, gmp_test_so, imath_test_so, *args)
5656
if fork:
57-
sys.exit(eq is not True)
57+
sys.exit(not eq)
5858
else:
5959
return eq
6060
else:

0 commit comments

Comments
 (0)