Python3 fixes

pull/11231/head
Olli-Pekka Puolitaival 2019-08-15 09:26:06 +03:00
parent a64ab312dd
commit aa1d16e871
4 changed files with 7 additions and 7 deletions

View File

@ -331,7 +331,7 @@ class Exporter(object):
@classmethod
def all_supported_targets(cls):
return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
return [t for t in list(TARGET_MAP) if cls.is_target_supported(t)]
@staticmethod
def filter_dot(str):

View File

@ -368,15 +368,15 @@ class GNUARMEclipse(Exporter):
# -------------------------------------------------------------------------
def dump_tree(self, nodes, depth=0):
for k in nodes.keys():
for k in list(nodes):
node = nodes[k]
parent_name = node['parent'][
'name'] if 'parent' in node.keys() else ''
'name'] if 'parent' in list(node) else ''
if len(node['children'].keys()) != 0:
self.dump_tree(node['children'], depth + 1)
def dump_paths(self, nodes, depth=0):
for k in nodes.keys():
for k in list(nodes):
node = nodes[k]
parts = []
while True:

View File

@ -41,7 +41,7 @@ class IAR(Exporter):
@classmethod
def is_target_supported(cls, target_name):
target = TARGET_MAP[target_name]
return _supported(target, _GUI_OPTIONS.keys())
return _supported(target, list(_GUI_OPTIONS))
def iar_groups(self, grouped_src):
@ -92,7 +92,7 @@ class IAR(Exporter):
"IlinkProgramEntryLabel": "__iar_program_start",
}
iar_defaults.update(device_info)
IARdevice = namedtuple('IARdevice', iar_defaults.keys())
IARdevice = namedtuple('IARdevice', list(iar_defaults))
return IARdevice(**iar_defaults)
def format_file(self, file):

View File

@ -41,7 +41,7 @@ from tools.toolchains import TOOLCHAINS
from tools.utils import write_json_to_file
SUPPORTED_TOOLCHAINS = list(TOOLCHAINS - set(u'uARM'))
SUPPORTED_IDES = [exp for exp in EXPORTERS.keys() + EXPORTER_ALIASES.keys()
SUPPORTED_IDES = [exp for exp in list(EXPORTERS) + list(EXPORTER_ALIASES)
if exp != "cmsis" and exp != "zip"]