From c3cfff0f52f860b1e0ec3c0ab6ee4183ca9dd5bc Mon Sep 17 00:00:00 2001 From: Stephen Link <32150373+stephenlink1993@users.noreply.github.com> Date: Thu, 10 Oct 2019 14:48:27 -0700 Subject: [PATCH] replace finally with except (#13) --- lib/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ec2.py b/lib/ec2.py index b440855..7fb5085 100644 --- a/lib/ec2.py +++ b/lib/ec2.py @@ -113,7 +113,7 @@ def __launch_instance(self, index: int = 0): def __enter__(self): try: return self.__launch_instance() - finally: + except: self.__exit__(*sys.exc_info()) def __exit__(self, type, value, traceback):