From 81722436beec79026635743669bc0fe40ec0158a Mon Sep 17 00:00:00 2001 From: Mark Ruzicka Date: Wed, 12 Feb 2025 14:43:34 -0600 Subject: [PATCH] testing to see if when a serial error is reported(due to disconnection) if calling the close serial function, quickly resolves the problem --- instrumentctl/G9SP_interlock/g9_driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentctl/G9SP_interlock/g9_driver.py b/instrumentctl/G9SP_interlock/g9_driver.py index 4cb92d7a..4f7ef9d2 100644 --- a/instrumentctl/G9SP_interlock/g9_driver.py +++ b/instrumentctl/G9SP_interlock/g9_driver.py @@ -200,8 +200,9 @@ def _read_response(self): return data - except serial.SerialException as e: + except (serial.SerialException, OSError) as e: self.log("Serial Error when reading G9 response", LogLevel.ERROR) + self._close_serial() raise e def _process_response(self, data):