west: nrfjprog.py: Remove len() from conditional to fix pylint warning
Empty sequences are falsy in Python, so len() can be skipped. Fixing pylint warnings for a CI check. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
5d307c98fe
commit
f5d8ece3b7
1 changed files with 3 additions and 2 deletions
|
@ -58,10 +58,11 @@ class NrfJprogBinaryRunner(ZephyrBinaryRunner):
|
||||||
snrs = self.check_output(['nrfjprog', '--ids'])
|
snrs = self.check_output(['nrfjprog', '--ids'])
|
||||||
snrs = snrs.decode(sys.getdefaultencoding()).strip().splitlines()
|
snrs = snrs.decode(sys.getdefaultencoding()).strip().splitlines()
|
||||||
|
|
||||||
if len(snrs) == 0:
|
if not snrs:
|
||||||
raise RuntimeError('"nrfjprog --ids" did not find a board; '
|
raise RuntimeError('"nrfjprog --ids" did not find a board; '
|
||||||
'is the board connected?')
|
'is the board connected?')
|
||||||
elif len(snrs) == 1:
|
|
||||||
|
if len(snrs) == 1:
|
||||||
board_snr = snrs[0]
|
board_snr = snrs[0]
|
||||||
if board_snr == '0':
|
if board_snr == '0':
|
||||||
raise RuntimeError('"nrfjprog --ids" returned 0; '
|
raise RuntimeError('"nrfjprog --ids" returned 0; '
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue