jphalip / ticlib

Python library to drive Pololu Tic stepper motor controllers
BSD 2-Clause "Simplified" License
19 stars 3 forks source link

handle gracefully a serial read returning 'None' #2

Closed gtlv97dot6 closed 3 years ago

gtlv97dot6 commented 3 years ago

In micropython, a UART.read() timing out returns 'None'. Raising a RuntimeError with a meaningful message seems to be better than getting an exception when attempting to get the len() of a None type.

jphalip commented 3 years ago

That makes sense. Thanks for the contribution!