The i2c i/o error code currently tried to use e which only exists in the scope of the earlier except block. The correct scope variable is error which e is assigned out to.
The existing code will yield UnboundLocalError "local variable 'e' referenced before assignment" instead of passing the original error.
The i2c i/o error code currently tried to use
e
which only exists in the scope of the earlierexcept
block. The correct scope variable iserror
whiche
is assigned out to.The existing code will yield UnboundLocalError "local variable 'e' referenced before assignment" instead of passing the original error.