diff --git a/tools/export/exporters.py b/tools/export/exporters.py index c69d7c7e20..0bfc705183 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -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): diff --git a/tools/export/gnuarmeclipse/__init__.py b/tools/export/gnuarmeclipse/__init__.py index f458f71719..1b4981608d 100644 --- a/tools/export/gnuarmeclipse/__init__.py +++ b/tools/export/gnuarmeclipse/__init__.py @@ -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: diff --git a/tools/export/iar/__init__.py b/tools/export/iar/__init__.py index 17834b299a..02b82b0087 100644 --- a/tools/export/iar/__init__.py +++ b/tools/export/iar/__init__.py @@ -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): diff --git a/tools/test/examples/examples_lib.py b/tools/test/examples/examples_lib.py index ee0a421f23..1846624bf1 100644 --- a/tools/test/examples/examples_lib.py +++ b/tools/test/examples/examples_lib.py @@ -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"]