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