Pass a list iterator directly to "any" or "all" functions

This commit is contained in:
Ivan Kravets
2018-01-18 22:04:43 +02:00
parent 3caa2a9e8d
commit 2b4b2eb571
8 changed files with 14 additions and 15 deletions

View File

@@ -111,7 +111,7 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
"nobuild" not in ep.get_build_targets():
ctx.invoke(cmd_device_monitor)
found_error = any([status is False for (_, status) in results])
found_error = any(status is False for (_, status) in results)
if (found_error or not silent) and len(results) > 1:
click.echo()
@@ -411,6 +411,6 @@ def calculate_project_hash():
for root, _, files in walk(d):
for f in files:
path = join(root, f)
if not any([s in path for s in (".git", ".svn", ".pioenvs")]):
if not any(s in path for s in (".git", ".svn", ".pioenvs")):
structure.append(path)
return sha1(",".join(sorted(structure))).hexdigest() if structure else ""