summaryrefslogtreecommitdiffstatshomepage
path: root/tests/io/file-with.py
blob: 235072164159bf568994ac6141af8b480a7c15a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
f = open("io/data/file1")

with f as f2:
    print(f2.read())

# File should be closed
try:
    f.read()
except:
    # Note: CPython and us throw different exception trying to read from
    # close file.
    print("can't read file after with")