Skip to content

Commit 934101e

Browse files
author
Cruz Monrreal
authored
Merge pull request #6592 from cmonr/py3-tools-port
Updates tools to be runnable in Python 3
2 parents d680cee + 85ce95d commit 934101e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

tools/config/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ def format_validation_error(self, error, path):
393393
return self.format_validation_error(error.context[0], path)
394394
else:
395395
return "in {} element {}: {}".format(
396-
path, str(".".join(str(p) for p in error.absolute_path)), error.message)
396+
path, ".".join(p for p in error.absolute_path),
397+
error.message.replace('u\'','\''))
397398

398399
def __init__(self, tgt, top_level_dirs=None, app_config=None):
399400
"""Construct a mbed configuration
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"K64F": {
3-
"exception_msg": "Additional properties are not allowed (u'unknown_key' was unexpected)"
3+
"exception_msg": "Additional properties are not allowed ('unknown_key' was unexpected)"
44
}
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"K64F": {
3-
"exception_msg": "Additional properties are not allowed (u'unknown_key' was unexpected)"
3+
"exception_msg": "Additional properties are not allowed ('unknown_key' was unexpected)"
44
}
55
}

tools/test_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,11 +2113,13 @@ def find_tests(base_dir, target_name, toolchain_name, app_config=None):
21132113
# Also find any COMMON paths, we'll add these later once we find all the base tests
21142114
if 'COMMON' in relative_path_parts:
21152115
if relative_path_parts[0] != 'COMMON':
2116-
def predicate(base_pred, group_pred, (name, base, group, case)):
2116+
def predicate(base_pred, group_pred, name_base_group_case):
2117+
(name, base, group, case) = name_base_group_case
21172118
return base == base_pred and group == group_pred
21182119
commons.append((functools.partial(predicate, walk_base_dir, relative_path_parts[0]), d))
21192120
else:
2120-
def predicate(base_pred, (name, base, group, case)):
2121+
def predicate(base_pred, name_base_group_case):
2122+
(name, base, group, case) = name_base_group_case
21212123
return base == base_pred
21222124
commons.append((functools.partial(predicate, walk_base_dir), d))
21232125

0 commit comments

Comments
 (0)