Skip to content

Commit 1e31186

Browse files
committed
fix(python): fix comparison to True/False
1 parent 079fdef commit 1e31186

File tree

18 files changed

+24
-24
lines changed

18 files changed

+24
-24
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 == False:
110+
if foundSpec is False:
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 == False
159+
assert grabnext is False
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 == True:
185+
if attached is True:
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 == False:
169+
if options.crashed_only and this_thread_crashed is False:
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() == False:
98+
if debugger.IsValid() is False:
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() == False:
104+
if target.IsValid() is False:
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 == False
257-
and self.special == False
258-
and self.mutable == False
256+
and self.unicode is False
257+
and self.special is False
258+
and self.mutable is False
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() == False or value.GetValueAsUnsigned(0) == 0:
5+
if value is None or value.IsValid() is False 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() == False:
54+
if self.valobj.IsValid() is False:
5555
return None
5656
if index == 0:
5757
return self.valobj.GetChildMemberWithName("value")

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ def found_str(matched):
24462446
log_lines.append(pattern_line)
24472447

24482448
# Convert to bool because match objects
2449-
# are True-ish but != True itself
2449+
# are True-ish but is not True itself
24502450
matched = bool(matched)
24512451
if matched != matching:
24522452
break

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() == False:
48+
if debugger.GetAsync() is False:
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() == False)
64+
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
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() == False)
79+
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
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() == False)
98+
self.assertTrue(value.IsValid() and value.GetError().Success() is False)
9999
self.check_after_call()

0 commit comments

Comments
 (0)