From 9a73ac625a49d2dca83a1826c5c6952fbbd1a23f Mon Sep 17 00:00:00 2001 From: Aleksandr Stepanov Date: Thu, 16 Jun 2016 12:42:46 +0300 Subject: [PATCH] close before retry --- modem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modem.py b/modem.py index 657b20a..6a3545c 100644 --- a/modem.py +++ b/modem.py @@ -19,6 +19,7 @@ def run(self): try: self.modem.connect() except (TimeoutException,IOError) as e: + self.modem.close() exc_type, exc_value, exc_traceback = sys.exc_info() logging.debug(traceback.format_tb(exc_traceback)) time.sleep(10)