mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-06 10:10:17 +00:00
Fix #395: Call __exit__ on exception in with block
This commit is contained in:
parent
ef9b4779f4
commit
347f49b291
12
src/tests/test.py
Normal file
12
src/tests/test.py
Normal file
@ -0,0 +1,12 @@
|
||||
class Test:
|
||||
def __enter__(self):
|
||||
print("enter")
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc, tb):
|
||||
print("__exit__ called", exc_type)
|
||||
return False
|
||||
|
||||
with Test():
|
||||
print("inside")
|
||||
raise Exception("boom!")
|
||||
Loading…
x
Reference in New Issue
Block a user