diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-05-02 14:35:45 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-05-02 14:38:07 +0300 |
commit | 566d8f1d7e1eb1a0cd595d4e76401ea5d54b0ef4 (patch) | |
tree | 38591d2ed0ff81b5ed2ee12bd046a8a4f5375d5e /tests/misc/print_exception.py | |
parent | c816b893534579751daf6dc6dbf3249ace641623 (diff) | |
download | micropython-566d8f1d7e1eb1a0cd595d4e76401ea5d54b0ef4.tar.gz micropython-566d8f1d7e1eb1a0cd595d4e76401ea5d54b0ef4.zip |
tests: Make "io" modules fixes for CPython compatibility.
Previously, "import _io" worked on both CPython and MicroPython (essentially
by a chance on CPython, as there's not guarantee that its contents will stay
the same across versions), but as the module was renamed to uio, need to use
more robust import sequence for compatibility.
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 80f7f44166..9baac713ee 100644 --- a/tests/misc/print_exception.py +++ b/tests/misc/print_exception.py @@ -1,4 +1,7 @@ -import uio as io # uPy does not have io module builtin +try: + import uio as io +except ImportError: + import io import sys if hasattr(sys, 'print_exception'): print_exception = sys.print_exception |