Skip to content

Commit 31d00dd

Browse files
authored
Merge pull request #691 from cmonr/py3-warning-on-error
Modifed Python 3 warning to only print after an Exception occurs.
2 parents 29dfd5b + 0394a87 commit 31d00dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mbed/mbed.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,11 @@ def main():
32333233
if very_verbose:
32343234
traceback.print_exc(file=sys.stdout)
32353235
error("Unknown Error: %s" % e, 255)
3236+
finally:
3237+
# Warn user if Python 3 might have caused an exception.
3238+
if status and sys.version_info[0] == 3:
3239+
warning("Using Python 3 with Mbed OS 5.8 and earlier can cause errors with compiling, testing and exporting");
3240+
32363241
sys.exit(status or 0)
32373242

32383243

0 commit comments

Comments
 (0)