We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bf565e commit 072cf02Copy full SHA for 072cf02
1 file changed
tests/io/file-with.py
@@ -10,3 +10,12 @@
10
# Note: CPython and us throw different exception trying to read from
11
# close file.
12
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