Skip to content

Commit 4322bee

Browse files
committed
Python2+3: tests passing
1 parent cca4425 commit 4322bee

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

tools/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def _process_config_and_overrides(self, data, params, unit_name, unit_kind):
665665
# Check for invalid cumulative overrides in libraries
666666
if (unit_kind == 'library' and
667667
any(attr.startswith('target.extra_labels') for attr
668-
in overrides.iterkeys())):
668+
in overrides.keys())):
669669
raise ConfigException(
670670
"Target override 'target.extra_labels' in " +
671671
ConfigParameter.get_display_name(unit_name, unit_kind,

tools/memap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def parse_command_line(self, lines):
408408
if (not arg.startswith("-")) and arg.endswith(".o"):
409409
self.cmd_modules[basename(arg)] = arg
410410

411-
common_prefix = dirname(commonprefix(self.cmd_modules.values()))
411+
common_prefix = dirname(commonprefix(list(self.cmd_modules.values())))
412412
self.cmd_modules = {s: relpath(f, common_prefix)
413413
for s, f in self.cmd_modules.items()}
414414

tools/test/build_api/build_api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def tearDown(self):
5959
@patch('os.mkdir')
6060
@patch('tools.toolchains.exists', return_value=True)
6161
@patch('tools.toolchains.mbedToolchain.dump_build_profile')
62-
@patch('tools.utils.run_cmd', return_value=("", "", 0))
62+
@patch('tools.utils.run_cmd', return_value=(b'', b'', 0))
6363
def test_always_complete_build(self, *_):
6464
with MagicMock() as notify:
6565
toolchain = prepare_toolchain(self.src_paths, self.build_path, self.target,

tools/test/config/config_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def compare_config(cfg, expected):
4040
except KeyError:
4141
return "Unexpected key '%s' in configuration data" % k
4242
for k in expected:
43-
if k not in ["expected_macros", "expected_features"] + cfg.keys():
43+
if k not in ["expected_macros", "expected_features"] + list(cfg.keys()):
4444
return "Expected key '%s' was not found in configuration data" % k
4545
return ""
4646

@@ -85,7 +85,7 @@ def test_config(name):
8585
if expected_features is not None:
8686
assert sorted(expected_features) == sorted(features)
8787
except ConfigException as e:
88-
err_msg = e.message
88+
err_msg = str(e)
8989
if "exception_msg" not in expected:
9090
assert not(err_msg), "Unexpected Error: %s" % e
9191
else:

0 commit comments

Comments
 (0)