autotest: Use ==/!= to compare constant literals (str, bytes, int, float, tuple)

Avoid SyntaxWarnings on Python >= 3.8

% `python3.8`
```
>>> "second" is "second"
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
```
`flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics`
```
./Tools/autotest/arducopter.py:3899:20: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
                if loop is not "second":
                   ^
./Tools/autotest/arducopter.py:4047:20: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
                if loop is not "second":
                   ^
2     F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
2
```
This commit is contained in:
Christian Clauss 2020-05-25 13:59:57 +02:00 committed by Peter Barker
parent a13ddc1096
commit b07fb05dde
1 changed files with 2 additions and 2 deletions

View File

@ -3896,7 +3896,7 @@ class AutoTestCopter(AutoTest):
except Exception as e:
self.progress("Exception caught in %s loop: %s" % (loop, self.get_exception_stacktrace(e)))
if loop is not "second":
if loop != "second":
continue
ex = e
break
@ -4044,7 +4044,7 @@ class AutoTestCopter(AutoTest):
except Exception as e:
self.progress("Exception caught in %s loop: %s" % (loop, self.get_exception_stacktrace(e)))
if loop is not "second":
if loop != "second":
continue
ex = e
break