mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-22 00:24:37 +00:00
25 lines
669 B
Python
25 lines
669 B
Python
"""Check that raise ... from .. uses a proper exception context """
|
|
|
|
# pylint: disable=unreachable, import-error
|
|
|
|
import socket, unknown
|
|
|
|
__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
|
|
raise IndexError from socket.error
|
|
raise IndexError() from None
|
|
raise IndexError() from ZeroDivisionError
|
|
raise IndexError() from ZeroDivisionError()
|
|
raise IndexError() from object()
|
|
raise IndexError() from unknown
|