Skip to content

Commit 404c1fc

Browse files
committed
cleanup
1 parent a490cfd commit 404c1fc

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

pymongo/asynchronous/encryption.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
from pymongo.operations import UpdateOne
8181
from pymongo.pool_options import PoolOptions
8282
from pymongo.pool_shared import (
83-
_async_configured_socket,
8483
_configured_protocol_interface,
8584
_get_timeout_details,
8685
_raise_connection_failure,
@@ -95,9 +94,6 @@
9594
if TYPE_CHECKING:
9695
from pymongocrypt.mongocrypt import MongoCryptKmsContext
9796

98-
from pymongo.pyopenssl_context import _sslConn
99-
from pymongo.typings import _Address
100-
10197

10298
_IS_SYNC = False
10399

@@ -113,13 +109,6 @@
113109
_KEY_VAULT_OPTS = CodecOptions(document_class=RawBSONDocument)
114110

115111

116-
async def _connect_kms(address: _Address, opts: PoolOptions) -> Union[socket.socket, _sslConn]:
117-
try:
118-
return await _async_configured_socket(address, opts)
119-
except Exception as exc:
120-
_raise_connection_failure(address, exc, timeout_details=_get_timeout_details(opts))
121-
122-
123112
@contextlib.contextmanager
124113
def _wrap_encryption_errors() -> Iterator[None]:
125114
"""Context manager to wrap encryption related errors."""
@@ -200,7 +189,6 @@ async def kms_request(self, kms_context: MongoCryptKmsContext) -> None:
200189
try:
201190
interface = await _configured_protocol_interface(address, opts)
202191
conn = AsyncBaseConnection(interface, opts)
203-
# Given a conn object, we want to send a message and then receive the bytes needed
204192
try:
205193
await async_sendall(interface.get_conn, message)
206194
interface.settimeout(max(_csot.clamp_remaining(_KMS_CONNECT_TIMEOUT), 0))

pymongo/synchronous/encryption.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
from pymongo.operations import UpdateOne
7575
from pymongo.pool_options import PoolOptions
7676
from pymongo.pool_shared import (
77-
_configured_socket,
7877
_configured_socket_interface,
7978
_get_timeout_details,
8079
_raise_connection_failure,
@@ -94,9 +93,6 @@
9493
if TYPE_CHECKING:
9594
from pymongocrypt.mongocrypt import MongoCryptKmsContext
9695

97-
from pymongo.pyopenssl_context import _sslConn
98-
from pymongo.typings import _Address
99-
10096

10197
_IS_SYNC = True
10298

@@ -112,13 +108,6 @@
112108
_KEY_VAULT_OPTS = CodecOptions(document_class=RawBSONDocument)
113109

114110

115-
def _connect_kms(address: _Address, opts: PoolOptions) -> Union[socket.socket, _sslConn]:
116-
try:
117-
return _configured_socket(address, opts)
118-
except Exception as exc:
119-
_raise_connection_failure(address, exc, timeout_details=_get_timeout_details(opts))
120-
121-
122111
@contextlib.contextmanager
123112
def _wrap_encryption_errors() -> Iterator[None]:
124113
"""Context manager to wrap encryption related errors."""
@@ -199,7 +188,6 @@ def kms_request(self, kms_context: MongoCryptKmsContext) -> None:
199188
try:
200189
interface = _configured_socket_interface(address, opts)
201190
conn = BaseConnection(interface, opts)
202-
# Given a conn object, we want to send a message and then receive the bytes needed
203191
try:
204192
sendall(interface.get_conn, message)
205193
interface.settimeout(max(_csot.clamp_remaining(_KMS_CONNECT_TIMEOUT), 0))

0 commit comments

Comments
 (0)