summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/try2.py
blob: 5cd74bec4b641f209f2677a25017b34027aae77b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# nested try's

try:
    print("try 1")
    try:
        print("try 2")
        foo()
    except:
        print("except 2")
    bar()
except:
    print("except 1")

try:
    print("try 1")
    try:
        print("try 2")
        foo()
    except TypeError:
        print("except 2")
    bar()
except NameError:
    print("except 1")