2727from pymongo .client_session import ClientSession
2828from pymongo .collection import Collection
2929from pymongo .command_cursor import CommandCursor , RawBatchCommandCursor
30- from pymongo .cursor import _QUERY_OPTIONS , Cursor , RawBatchCursor
30+ from pymongo .cursor import Cursor , RawBatchCursor
31+ from pymongo .cursor_shared import _QUERY_OPTIONS
3132from pymongo .database import Database
3233from pymongo .driver_info import DriverInfo
3334from pymongo .encryption import ClientEncryption
@@ -1769,8 +1770,6 @@ class AgnosticCursor(AgnosticBaseCursor):
17691770 comment = MotorCursorChainingMethod ()
17701771 allow_disk_use = MotorCursorChainingMethod ()
17711772
1772- _Cursor__die = AsyncRead ()
1773-
17741773 def rewind (self ):
17751774 """Rewind this cursor to its unevaluated state."""
17761775 self .delegate .rewind ()
@@ -1788,13 +1787,13 @@ def __deepcopy__(self, memo):
17881787 return self .__class__ (self .delegate .__deepcopy__ (memo ), self .collection )
17891788
17901789 def _query_flags (self ):
1791- return self .delegate ._Cursor__query_flags
1790+ return self .delegate ._query_flags
17921791
17931792 def _data (self ):
1794- return self .delegate ._Cursor__data
1793+ return self .delegate ._data
17951794
17961795 def _killed (self ):
1797- return self .delegate ._Cursor__killed
1796+ return self .delegate ._killed
17981797
17991798
18001799class AgnosticRawBatchCursor (AgnosticCursor ):
@@ -1806,8 +1805,6 @@ class AgnosticCommandCursor(AgnosticBaseCursor):
18061805 __motor_class_name__ = "MotorCommandCursor"
18071806 __delegate_class__ = CommandCursor
18081807
1809- _CommandCursor__die = AsyncRead ()
1810-
18111808 async def try_next (self ):
18121809 """Advance the cursor without blocking indefinitely.
18131810
@@ -1834,10 +1831,10 @@ def _query_flags(self):
18341831 return 0
18351832
18361833 def _data (self ):
1837- return self .delegate ._CommandCursor__data
1834+ return self .delegate ._data
18381835
18391836 def _killed (self ):
1840- return self .delegate ._CommandCursor__killed
1837+ return self .delegate ._killed
18411838
18421839
18431840class AgnosticRawBatchCommandCursor (AgnosticCommandCursor ):
@@ -1849,25 +1846,25 @@ class _LatentCursor:
18491846 """Take the place of a PyMongo CommandCursor until aggregate() begins."""
18501847
18511848 alive = True
1852- _CommandCursor__data = []
1853- _CommandCursor__id = None
1854- _CommandCursor__killed = False
1855- _CommandCursor__sock_mgr = None
1856- _CommandCursor__session = None
1857- _CommandCursor__explicit_session = None
1849+ _data = []
1850+ _id = None
1851+ _killed = False
1852+ _sock_mgr = None
1853+ _session = None
1854+ _explicit_session = None
18581855 cursor_id = None
18591856
18601857 def __init__ (self , collection ):
1861- self ._CommandCursor__collection = collection .delegate
1858+ self ._collection = collection .delegate
18621859
1863- def _CommandCursor__end_session (self , * args , ** kwargs ):
1860+ def _end_session (self , * args , ** kwargs ):
18641861 pass
18651862
1866- def _CommandCursor__die (self , * args , ** kwargs ):
1863+ def _die_lock (self , * args , ** kwargs ):
18671864 pass
18681865
18691866 def clone (self ):
1870- return _LatentCursor (self ._CommandCursor__collection )
1867+ return _LatentCursor (self ._collection )
18711868
18721869 def rewind (self ):
18731870 pass
@@ -1924,9 +1921,9 @@ def _on_started(self, original_future, future):
19241921 # Return early if the task was cancelled.
19251922 if original_future .done ():
19261923 return
1927- if self .delegate ._CommandCursor__data or not self .delegate .alive :
1924+ if self .delegate ._data or not self .delegate .alive :
19281925 # _get_more is complete.
1929- original_future .set_result (len (self .delegate ._CommandCursor__data ))
1926+ original_future .set_result (len (self .delegate ._data ))
19301927 else :
19311928 # Send a getMore.
19321929 future = super ()._get_more ()
0 commit comments