U
    @f(                     @   s4   d Z ddlZddlZddlmZ G dd deZdS )a  DEPRECATED - A manager to handle when cursors are killed after they are
closed.

New cursor managers should be defined as subclasses of CursorManager and can be
installed on a client by calling
:meth:`~pymongo.mongo_client.MongoClient.set_cursor_manager`.

.. versionchanged:: 3.3
   Deprecated, for real this time.

.. versionchanged:: 3.0
   Undeprecated. :meth:`~pymongo.cursor_manager.CursorManager.close` now
   requires an `address` argument. The ``BatchCursorManager`` class is removed.
    N)integer_typesc                   @   s    e Zd ZdZdd Zdd ZdS )CursorManagerz+DEPRECATED - The cursor manager base class.c                 C   s    t jdtdd t|| _dS )z[Instantiate the manager.

        :Parameters:
          - `client`: a MongoClient
        zCursor managers are deprecated.   )
stacklevelN)warningswarnDeprecationWarningweakrefref_CursorManager__client)selfclient r   :/tmp/pip-unpacked-wheel-gs_301nf/pymongo/cursor_manager.py__init__&   s    zCursorManager.__init__c                 C   s(   t |tstd|  |g| dS )a2  Kill a cursor.

        Raises TypeError if cursor_id is not an instance of (int, long).

        :Parameters:
          - `cursor_id`: cursor id to close
          - `address`: the cursor's server's (host, port) pair

        .. versionchanged:: 3.0
           Now requires an `address` argument.
        zcursor_id must be an integerN)
isinstancer   	TypeErrorr   Zkill_cursors)r   Z	cursor_idaddressr   r   r   close2   s    
zCursorManager.closeN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   #   s   r   )r   r   r	   Zbson.py3compatr   objectr   r   r   r   r   <module>   s   