From 16041cda0c7e5af93f087e9cfb9e8306f9812207 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 3 Sep 2019 14:36:06 +0200 Subject: [PATCH] west: zcmake.py: Simplify test with 'in' Getting slightly subjective, but fixes this pylint warning: scripts/west_commands/zcmake.py:186:13: R1714: Consider merging these comparisons with "in" to "type_ in ('STRING', 'INTERNAL')" (consider-using-in) Use a set literal instead of a tuple literal, as recent Python 3 versions optimize set literals with constant keys nicely. Getting rid of pylint warnings for a CI check. I could disable any controversial ones (it's already a list of warnings to enable anyway). Signed-off-by: Ulf Magnusson --- scripts/west_commands/zcmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/zcmake.py b/scripts/west_commands/zcmake.py index afc1366c911..a05e21fa6f0 100644 --- a/scripts/west_commands/zcmake.py +++ b/scripts/west_commands/zcmake.py @@ -183,7 +183,7 @@ class CMakeCacheEntry: except ValueError as exc: args = exc.args + ('on line {}: {}'.format(line_no, line),) raise ValueError(args) from exc - elif type_ == 'STRING' or type_ == 'INTERNAL': + elif type_ in {'STRING', 'INTERNAL'}: # If the value is a CMake list (i.e. is a string which # contains a ';'), convert to a Python list. if ';' in value: