diff options
author | Damien George <damien.p.george@gmail.com> | 2014-12-18 13:37:56 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-12-18 13:37:56 +0000 |
commit | 6936f4626c8748c077ad2c63827d4deeb43b867d (patch) | |
tree | 4b937457bf883b9d9ec5e17d2bc78d5d0b71abe0 /tests/misc/print_exception.py | |
parent | c8b0229bc7c615a636c05442e3ad590fb7cc0ec0 (diff) | |
download | micropython-6936f4626c8748c077ad2c63827d4deeb43b867d.tar.gz micropython-6936f4626c8748c077ad2c63827d4deeb43b867d.zip |
tests: Get misc/print_exception and pyb/spi working on pyboard.
Diffstat (limited to 'tests/misc/print_exception.py')
-rw-r--r-- | tests/misc/print_exception.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/misc/print_exception.py b/tests/misc/print_exception.py index ba99ed48ba..e65b8d1ac5 100644 --- a/tests/misc/print_exception.py +++ b/tests/misc/print_exception.py @@ -14,8 +14,11 @@ except Exception as e: print_exception(e, buf) s = buf.getvalue() for l in s.split("\n"): + # uPy on pyboard prints <stdin> as file, so remove filename. + if l.startswith(" File "): + print(l[:8], l[-23:]) # uPy and CPy tracebacks differ in that CPy prints a source line for # each traceback entry. In this case, we know that offending line # has 4-space indent, so filter it out. - if not l.startswith(" "): + elif not l.startswith(" "): print(l) |