Skip to content

Commit aa1d16e

Browse files
author
Olli-Pekka Puolitaival
committed
Python3 fixes
1 parent a64ab31 commit aa1d16e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tools/export/exporters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def is_target_supported(cls, target_name):
331331

332332
@classmethod
333333
def all_supported_targets(cls):
334-
return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
334+
return [t for t in list(TARGET_MAP) if cls.is_target_supported(t)]
335335

336336
@staticmethod
337337
def filter_dot(str):

tools/export/gnuarmeclipse/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,15 @@ def compute_exclusions(self):
368368
# -------------------------------------------------------------------------
369369

370370
def dump_tree(self, nodes, depth=0):
371-
for k in nodes.keys():
371+
for k in list(nodes):
372372
node = nodes[k]
373373
parent_name = node['parent'][
374-
'name'] if 'parent' in node.keys() else ''
374+
'name'] if 'parent' in list(node) else ''
375375
if len(node['children'].keys()) != 0:
376376
self.dump_tree(node['children'], depth + 1)
377377

378378
def dump_paths(self, nodes, depth=0):
379-
for k in nodes.keys():
379+
for k in list(nodes):
380380
node = nodes[k]
381381
parts = []
382382
while True:

tools/export/iar/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class IAR(Exporter):
4141
@classmethod
4242
def is_target_supported(cls, target_name):
4343
target = TARGET_MAP[target_name]
44-
return _supported(target, _GUI_OPTIONS.keys())
44+
return _supported(target, list(_GUI_OPTIONS))
4545

4646

4747
def iar_groups(self, grouped_src):
@@ -92,7 +92,7 @@ def iar_device(self):
9292
"IlinkProgramEntryLabel": "__iar_program_start",
9393
}
9494
iar_defaults.update(device_info)
95-
IARdevice = namedtuple('IARdevice', iar_defaults.keys())
95+
IARdevice = namedtuple('IARdevice', list(iar_defaults))
9696
return IARdevice(**iar_defaults)
9797

9898
def format_file(self, file):

tools/test/examples/examples_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from tools.utils import write_json_to_file
4242

4343
SUPPORTED_TOOLCHAINS = list(TOOLCHAINS - set(u'uARM'))
44-
SUPPORTED_IDES = [exp for exp in EXPORTERS.keys() + EXPORTER_ALIASES.keys()
44+
SUPPORTED_IDES = [exp for exp in list(EXPORTERS) + list(EXPORTER_ALIASES)
4545
if exp != "cmsis" and exp != "zip"]
4646

4747

0 commit comments

Comments
 (0)