def close(self):
		'''关闭与数据库的连接'''
		if VERBOSE:
			print 'Database connection CLOSE.'
		self.conn.close()
def _try_write_with_flush(cls, fileobj, payload):
        """This method is here so that it can be patched to simulate write errors.

        This is because mock can't patch primitive objects like file objects.
        """
        fileobj.write(payload)
        fileobj.flush()