def checkDerivedCatch():
    class A(BaseException):
        pass
    class B(A):
        def __init__(self):
            pass

    a = A()
    b = B()

    try:
        raise A, b
    except B, v:
        print("Caught B", v)
    except A, v:
        print("Didn't catch as B, but as A, Python3 does that", v)
    else:
        print("Not caught A class, not allowed to happen.")

    try:
        raise B, a
    except __HOLE__, e:
        print("TypeError with pair form for class not taking args:", e)
dataset/ETHPy150Open kayhayen/Nuitka/tests/basics/ExceptionRaising.py/checkDerivedCatch