summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/op_error_intbig.py
blob: 432c05a9fe4086fdfd5b1a32a9452e7b21a761b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# test errors from bad operations (unary, binary, etc)

def test_exc(code, exc):
    try:
        exec(code)
        print("no exception")
    except exc:
        print("right exception")
    except:
        print("wrong exception")

# object with buffer protocol needed on rhs
test_exc("(1 << 70) in 1", TypeError)