Skip to content

Commit 6693b08

Browse files
committed
Use print function in project.py
1 parent 6d374c6 commit 6693b08

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/project.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" The CLI entry point for exporting projects from the mbed tools to any of the
22
supported IDEs or project structures.
33
"""
4+
from __future__ import absolute_import, print_function
45
import sys
56
from os.path import join, abspath, dirname, exists, basename
67
ROOT = abspath(join(dirname(__file__), ".."))
@@ -191,15 +192,15 @@ def main():
191192

192193
# Print available tests in order and exit
193194
if options.list_tests is True:
194-
print '\n'.join([str(test) for test in sorted(TEST_MAP.values())])
195+
print('\n'.join([str(test) for test in sorted(TEST_MAP.values())]))
195196
sys.exit()
196197

197198
# Only prints matrix of supported IDEs
198199
if options.supported_ides:
199200
if options.supported_ides == "matrix":
200201
print_large_string(mcu_ide_matrix())
201202
elif options.supported_ides == "ides":
202-
print mcu_ide_list()
203+
print(mcu_ide_list())
203204
exit(0)
204205

205206
# Only prints matrix of supported IDEs
@@ -212,9 +213,9 @@ def main():
212213
readme.write("\n")
213214
readme.write(html)
214215
except IOError as exc:
215-
print "I/O error({0}): {1}".format(exc.errno, exc.strerror)
216+
print("I/O error({0}): {1}".format(exc.errno, exc.strerror))
216217
except:
217-
print "Unexpected error:", sys.exc_info()[0]
218+
print("Unexpected error:", sys.exc_info()[0])
218219
raise
219220
exit(0)
220221

@@ -253,7 +254,7 @@ def main():
253254
project_id=options.program, zip_proj=zip_proj,
254255
build_profile=profile, app_config=options.app_config)
255256
except NotSupportedException as exc:
256-
print "[ERROR] %s" % str(exc)
257+
print("[ERROR] %s" % str(exc))
257258

258259
if __name__ == "__main__":
259260
main()

0 commit comments

Comments
 (0)