From 610776923986868e5a434e7ebd1975dacd931f94 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Puolitaival Date: Mon, 13 Aug 2018 12:15:21 +0300 Subject: [PATCH 1/3] Fix build_data functionality with python 3 --- tools/build_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_api.py b/tools/build_api.py index 02672ca499..1d60c821b3 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -1356,4 +1356,4 @@ def merge_build_data(filename, toolchain_report, app_type): if 'type' not in build[0]: build[0]['type'] = app_type build_data['builds'].append(build[0]) - dump(build_data, open(filename, "wb"), indent=4, separators=(',', ': ')) + dump(build_data, open(filename, "w"), indent=4, separators=(',', ': ')) From 72a0bd437424d36ab7db144ff375d0d6e6797d4d Mon Sep 17 00:00:00 2001 From: Olli-Pekka Puolitaival Date: Mon, 13 Aug 2018 12:42:48 +0300 Subject: [PATCH 2/3] Print stack trace in case of verbose --- tools/test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test.py b/tools/test.py index df9b837844..179c7fb30b 100644 --- a/tools/test.py +++ b/tools/test.py @@ -220,6 +220,9 @@ if __name__ == '__main__': # NotSupportedException is handled by the build log pass except Exception as e: + if options.verbose: + import traceback + traceback.print_exc() # Some other exception occurred, print the error message print(e) From 2059fed945e4cf5aba4c336047d75e03f3fdaf03 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Puolitaival Date: Mon, 13 Aug 2018 12:43:15 +0300 Subject: [PATCH 3/3] Fix building with python 3 --- tools/toolchains/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 65dfcc928b..bdde695aef 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -321,7 +321,7 @@ class mbedToolchain: except IOError: old_md5 = None if old_md5 != new_md5: - with open(via_file, "w") as fd: + with open(via_file, "wb") as fd: fd.write(to_write) return via_file