From 540a3432944d60d59ca02dc5ac845527736957b4 Mon Sep 17 00:00:00 2001 From: Riley King Date: Fri, 5 Sep 2025 13:22:18 +1000 Subject: [PATCH 1/2] Changed FTD2XXError to use `Exception` as a base rather than `BaseException`. No script catches it meaning that if the FTDI driver raises an exception while a power supply is live, it will not be turned off. --- src/fixate/drivers/ftdi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fixate/drivers/ftdi.py b/src/fixate/drivers/ftdi.py index 3b737641..dd136101 100644 --- a/src/fixate/drivers/ftdi.py +++ b/src/fixate/drivers/ftdi.py @@ -44,7 +44,7 @@ } -class FTD2XXError(BaseException): +class FTD2XXError(Exception): pass From 948f4d51dcf95ceab9c6ab362bd6dc504adc05c4 Mon Sep 17 00:00:00 2001 From: Riley King Date: Fri, 5 Sep 2025 13:23:38 +1000 Subject: [PATCH 2/2] This is an optional continuance from 540a3432944d60d59ca02dc5ac845527736957b4 that replaces *ALL* occurances of BaseException with Exception. Realistically there is no reason to be using BaseException over Exception unless you want to kill the program. --- src/fixate/core/exceptions.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/fixate/core/exceptions.py b/src/fixate/core/exceptions.py index d151e5bd..7288bd02 100644 --- a/src/fixate/core/exceptions.py +++ b/src/fixate/core/exceptions.py @@ -1,20 +1,20 @@ -class SequenceAbort(BaseException): +class SequenceAbort(Exception): pass -class ScriptError(BaseException): +class ScriptError(Exception): pass -class TestRetryExceeded(BaseException): +class TestRetryExceeded(Exception): pass -class TestAbort(BaseException): +class TestAbort(Exception): pass -class InstrumentError(BaseException): +class InstrumentError(Exception): pass @@ -22,11 +22,11 @@ class InstrumentTimeOut(InstrumentError): pass -class ParameterError(BaseException): +class ParameterError(Exception): pass -class InvalidScalarQuantityError(BaseException): +class InvalidScalarQuantityError(Exception): pass @@ -38,7 +38,7 @@ class InstrumentNotConnected(InstrumentError): pass -class NotCompatible(BaseException): +class NotCompatible(Exception): pass @@ -46,21 +46,21 @@ class MissingParameters(ParameterError): pass -class UserInputError(BaseException): +class UserInputError(Exception): pass -class TestClassError(BaseException): +class TestClassError(Exception): pass -class TestError(BaseException): +class TestError(Exception): pass -class DUTError(BaseException): +class DUTError(Exception): pass -class CheckFail(BaseException): +class CheckFail(Exception): pass