diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/misc/sys_exc_info.py | 22 | ||||
-rwxr-xr-x | tests/run-tests | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/misc/sys_exc_info.py b/tests/misc/sys_exc_info.py new file mode 100644 index 0000000000..1aad6f1898 --- /dev/null +++ b/tests/misc/sys_exc_info.py @@ -0,0 +1,22 @@ +import sys +try: + sys.exc_info +except: + print("SKIP") + sys.exit() + +def f(): + print(sys.exc_info()[0:2]) + +try: + 1/0 +except: + print(sys.exc_info()[0:2]) + f() + +# MicroPython currently doesn't reset sys.exc_info() value +# on exit from "except" block. +#f() + +# Recursive except blocks are not handled either - just don't +# use exc_info() at all! diff --git a/tests/run-tests b/tests/run-tests index ebe295c7df..36d9258cfe 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -171,6 +171,7 @@ def run_tests(pyb, tests, args): skip_tests.add('misc/features.py') # requires raise_varargs skip_tests.add('misc/rge_sm.py') # requires yield skip_tests.add('misc/print_exception.py') # because native doesn't have proper traceback info + skip_tests.add('misc/sys_exc_info.py') # sys.exc_info() is not supported for native for test_file in tests: test_basename = os.path.basename(test_file) |