

def __die(self):
    'Closes this cursor.\n        '
    if (self.__id and (not self.__killed)):
        if (self.__exhaust and self.__exhaust_mgr):
            self.__exhaust_mgr.sock.close()
        else:
            connection = self.__collection.database.connection
            if (self.__connection_id is not None):
                connection.close_cursor(self.__id, self.__connection_id)
            else:
                connection.close_cursor(self.__id)
    if (self.__exhaust and self.__exhaust_mgr):
        self.__exhaust_mgr.close()
    self.__killed = True

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.__die/original