Closed dglaude closed 4 years ago
Looks like enable
should be defined in the top of the script as enable = None
. In fact I'd probably refactor that to enable_pin
.
Then a check for if enable_pin is not None:
in cleanup()
should suffice.
There's always the trap the exception method, too, but in cases like this I definitely prefer the former.
This is- with any luck- fixed in #10
Running this simple code:
Trigger the following output:
This is actually what the demo code is doing:
At least if the first call to gas.read_all() fail with an exception.