Skip to content

Commit 072cf02

Browse files
committed
tests/file-with: Add testcase which failed for @dpgeorge.
Works on x86.
1 parent 5bf565e commit 072cf02

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/io/file-with.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@
1010
# Note: CPython and us throw different exception trying to read from
1111
# close file.
1212
print("can't read file after with")
13+
14+
15+
# Regression test: test that exception in with initialization properly
16+
# thrown and doesn't crash.
17+
try:
18+
with open('__non_existent', 'r'):
19+
pass
20+
except OSError:
21+
print("OSError")

0 commit comments

Comments
 (0)