high-yak-85899
03/02/2022, 11:09 PMwith MyClass():
while True:
time.sleep(1)
When I run this, I see MyClass.__enter__
called, but if I Ctrl+C, I never see MyClass.__exit__
called. This only happens with Pants. If I run my program as python my_prog.py
, then I see MyClass.__exit__
successfully called. Is there any way to recover this behavior? It makes sense to me why this is happening, but I'd really like to make sure I can gracefully shut down things.happy-kitchen-89482
03/02/2022, 11:16 PMhigh-yak-85899
03/02/2022, 11:18 PMhigh-yak-85899
03/02/2022, 11:19 PMhigh-yak-85899
03/02/2022, 11:19 PMhundreds-father-404
03/02/2022, 11:41 PMhigh-yak-85899
03/26/2022, 12:47 AMhappy-kitchen-89482
03/26/2022, 3:11 AM