summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/op_error_intbig.py
blob: 7def75b0c6c17672c552a9d0c8b2695f756a3900 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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
try:
    (1 << 70) in 1
except TypeError:
    print('TypeError')