Skip to content
Snippets Groups Projects
Commit 6936f462 authored by Damien George's avatar Damien George
Browse files

tests: Get misc/print_exception and pyb/spi working on pyboard.

parent c8b0229b
Branches
No related tags found
No related merge requests found
...@@ -14,8 +14,11 @@ except Exception as e: ...@@ -14,8 +14,11 @@ except Exception as e:
print_exception(e, buf) print_exception(e, buf)
s = buf.getvalue() s = buf.getvalue()
for l in s.split("\n"): 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 # uPy and CPy tracebacks differ in that CPy prints a source line for
# each traceback entry. In this case, we know that offending line # each traceback entry. In this case, we know that offending line
# has 4-space indent, so filter it out. # has 4-space indent, so filter it out.
if not l.startswith(" "): elif not l.startswith(" "):
print(l) print(l)
SPI(1) SPI(1)
SPI(1, SPI.MASTER, baudrate=328125, polarity=1, phase=0, bits=8) SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8)
SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8)
b'\xff' b'\xff'
b'\xff' b'\xff'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment