That exception class is an attribute of the serial module, not of the Serial 
object instance, "ser", that you have there.

So catch serial.SerialException.

I think you're importing and handling the exceptions fine. For importing, you 
won't be able to access all the other stuff in the serial module if you just 
import the Serial class. Also, polluting the global name space makes things 
confusing for those reading your code ("where did this come from?" rather than, 
"this is obviously from the serial module"). 
For the exception, there's no reason to catch all here. Catch what you expect 
and leave the regular traceback for the rest.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to