Skip to content
Commit 2481a125 authored by Ulf Magnusson's avatar Ulf Magnusson Committed by Anas Nashif
Browse files

samples: intel_s1000: Simplify code and fix pylint warning



Empty sequences in Python are falsy, so

    if len(config_file) != 0:

can be simplified to

    if config_file:

pylint warning:

    C1801: Do not use `len(SEQUENCE)` to determine if a sequence is
    empty (len-as-condition)

Simplify the code a bit with os.path.join(), which indirectly gets rid
of the warning. os.path.join('', 'foo') returns 'foo', so things work
out when os.path.basename() returns '' (no directory) as well.

I'm getting rid of pylint warnings for a CI check.

Also replace a '== None' with 'is None', which is more common.

Signed-off-by: default avatarUlf Magnusson <Ulf.Magnusson@nordicsemi.no>
parent d4c851ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment