forked from platformio/platformio-core
Iterating the dictionary directly instead of calling .keys()
This commit is contained in:
@ -86,7 +86,7 @@ MBED_LIBS_MAP = {
|
||||
|
||||
def get_mbedlib_includes():
|
||||
result = []
|
||||
for lib in MBED_LIBS_MAP.keys():
|
||||
for lib in MBED_LIBS_MAP:
|
||||
includes = []
|
||||
lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", lib)
|
||||
for _, _, files in walk(lib_dir):
|
||||
|
@ -154,7 +154,7 @@ def ProcessUnFlags(env, flags):
|
||||
all_flags.extend(items)
|
||||
all_flags = set(all_flags)
|
||||
|
||||
for key in parsed_flags.keys():
|
||||
for key in parsed_flags:
|
||||
cur_flags = set(env.get(key, []))
|
||||
for item in cur_flags & all_flags:
|
||||
while item in env[key]:
|
||||
|
@ -153,7 +153,7 @@ def lib_install(ctx, libid, version):
|
||||
def lib_install_dependency(ctx, data):
|
||||
assert isinstance(data, dict)
|
||||
query = []
|
||||
for key in data.keys():
|
||||
for key in data:
|
||||
if key in ("authors", "frameworks", "platforms", "keywords"):
|
||||
values = data[key]
|
||||
if not isinstance(values, list):
|
||||
|
@ -101,7 +101,7 @@ class Upgrader(object):
|
||||
prev_platforms = []
|
||||
|
||||
# remove platform's folder (obsolete package structure)
|
||||
for name in PlatformFactory.get_platforms().keys():
|
||||
for name in PlatformFactory.get_platforms():
|
||||
pdir = join(get_home_dir(), name)
|
||||
if not isdir(pdir):
|
||||
continue
|
||||
@ -234,7 +234,7 @@ def check_internal_updates(ctx, what):
|
||||
|
||||
outdated_items = []
|
||||
if what == "platforms":
|
||||
for platform in PlatformFactory.get_platforms(installed=True).keys():
|
||||
for platform in PlatformFactory.get_platforms(installed=True):
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
if p.is_outdated():
|
||||
outdated_items.append(platform)
|
||||
|
@ -326,7 +326,7 @@ def backup_reports(items):
|
||||
|
||||
for params in items:
|
||||
# skip static options
|
||||
for key in params.keys():
|
||||
for key in params:
|
||||
if key in ("v", "tid", "cid", "cd1", "cd2", "sr", "an"):
|
||||
del params[key]
|
||||
|
||||
|
Reference in New Issue
Block a user