third_party.pylibs.pylint.src/test/input/func_bad_exception_context_py30.py

18 lines
393 B
Python
Raw Normal View History

"""Check that raise ... from .. uses a proper exception context """
# pylint: disable=unreachable
__revision__ = 0
class ExceptionSubclass(Exception):
""" subclass """
def test():
""" docstring """
raise IndexError from 1
raise IndexError from None
raise IndexError from ZeroDivisionError
raise IndexError from object()
raise IndexError from ExceptionSubclass