def __del__(self):
if self.debug:<EOL><INDENT>sys.stderr.write("<STR_LIT>" %(<EOL>self.__class__.__name__,<EOL>self.ser<EOL>))<EOL><DEDENT>if self.ser:<EOL><INDENT>self.ser.close()<EOL><DEDENT>
Close device when YHSM instance is destroyed.