swapped "is" for "==" in literal comparison

update lint-python.sh to include check F632
This commit is contained in:
Tyler Chambers 2020-11-08 16:35:13 -05:00
parent 7e373294a5
commit b6121edf70
2 changed files with 2 additions and 1 deletions

View file

@ -62,7 +62,7 @@ def get_ELF_program_headers(executable):
splitline = [x.strip() for x in line.split()] splitline = [x.strip() for x in line.split()]
flags = splitline[ofs_flags] flags = splitline[ofs_flags]
# check for 'R', ' E' # check for 'R', ' E'
if splitline[ofs_flags + 1] is 'E': if splitline[ofs_flags + 1] == 'E':
flags += ' E' flags += ' E'
headers.append((typ, flags, [])) headers.append((typ, flags, []))
count += 1 count += 1

View file

@ -55,6 +55,7 @@ enabled=(
F621 # too many expressions in an assignment with star-unpacking F621 # too many expressions in an assignment with star-unpacking
F622 # two or more starred expressions in an assignment (a, *b, *c = d) F622 # two or more starred expressions in an assignment (a, *b, *c = d)
F631 # assertion test is a tuple, which are always True F631 # assertion test is a tuple, which are always True
F632 # use ==/!= to compare str, bytes, and int literals
F701 # a break statement outside of a while or for loop F701 # a break statement outside of a while or for loop
F702 # a continue statement outside of a while or for loop F702 # a continue statement outside of a while or for loop
F703 # a continue statement in a finally block in a loop F703 # a continue statement in a finally block in a loop