diff options
Diffstat (limited to 'tests/basics/exception_chain.py')
-rw-r--r-- | tests/basics/exception_chain.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/exception_chain.py b/tests/basics/exception_chain.py index c3a7d6b11..14dd6dfba 100644 --- a/tests/basics/exception_chain.py +++ b/tests/basics/exception_chain.py @@ -1,6 +1,15 @@ # Exception chaining is not supported, but check that basic # exception works as expected. + try: raise Exception from None except Exception: print("Caught Exception") + +try: + try: + raise ValueError("Value") + except Exception as exc: + raise RuntimeError("Runtime") from exc +except Exception as ex2: + print("Caught Exception:", ex2) |