summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/op_error_literal.py
blob: 00244ee2b2a20808d288cbfd07b1b452d978382f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# test errors from bad operations with literals
# these raise a SyntaxWarning in CPython; see https://bugs.python.org/issue15248

# unsupported subscription
try:
    1[0]
except TypeError:
    print("TypeError")
try:
    ""[""]
except TypeError:
    print("TypeError")

# not callable
try:
    1()
except TypeError:
    print("TypeError")