Skip to content

Commit b0afe91

Browse files
committed
SH review
1 parent 6eaf094 commit b0afe91

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pymongo/synchronous/client_session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
_SESSION: ContextVar[Optional[ClientSession]] = ContextVar("SESSION", default=None)
185185

186186

187-
class BoundSessionContext:
187+
class _BoundSessionContext:
188188
"""Context manager returned by ClientSession.bind() that manages bound state."""
189189

190190
def __init__(self, session: ClientSession, end_session: bool) -> None:
@@ -569,14 +569,14 @@ def _check_ended(self) -> None:
569569
if self._server_session is None:
570570
raise InvalidOperation("Cannot use ended session")
571571

572-
def bind(self, end_session: bool = False) -> BoundSessionContext:
572+
def bind(self, end_session: bool = False) -> _BoundSessionContext:
573573
"""Bind this session so it is implicitly passed to all database operations within the returned context.
574574
575575
:param end_session: Whether to end the session on exiting the returned context. Defaults to False.
576576
577577
.. versionadded:: 4.17
578578
"""
579-
return BoundSessionContext(self, end_session)
579+
return _BoundSessionContext(self, end_session)
580580

581581
def __enter__(self) -> ClientSession:
582582
return self

tools/synchro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"AsyncRawBatchCursor": "RawBatchCursor",
3838
"AsyncRawBatchCommandCursor": "RawBatchCommandCursor",
3939
"AsyncClientSession": "ClientSession",
40-
"_AsyncBoundSessionContext": "BoundSessionContext",
40+
"_AsyncBoundSessionContext": "_BoundSessionContext",
4141
"AsyncChangeStream": "ChangeStream",
4242
"AsyncCollectionChangeStream": "CollectionChangeStream",
4343
"AsyncDatabaseChangeStream": "DatabaseChangeStream",

0 commit comments

Comments
 (0)