Skip to content

Commit d203f68

Browse files
authored
PYTHON-3904 Fix socket vs _socket pyopenssl typing (#1345)
1 parent 0660f32 commit d203f68

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pymongo/pyopenssl_context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from pymongo.write_concern import validate_boolean
4343

4444
if TYPE_CHECKING:
45-
import socket
4645
from ssl import VerifyMode
4746

4847
from cryptography.x509 import Certificate
@@ -106,7 +105,7 @@ def _ragged_eof(exc: BaseException) -> bool:
106105
# https://docs.python.org/3/library/ssl.html#notes-on-non-blocking-sockets
107106
class _sslConn(_SSL.Connection):
108107
def __init__(
109-
self, ctx: _SSL.Context, sock: Optional[socket.socket], suppress_ragged_eofs: bool
108+
self, ctx: _SSL.Context, sock: Optional[_socket.socket], suppress_ragged_eofs: bool
110109
):
111110
self.socket_checker = _SocketChecker()
112111
self.suppress_ragged_eofs = suppress_ragged_eofs
@@ -370,7 +369,7 @@ def set_default_verify_paths(self) -> None:
370369

371370
def wrap_socket(
372371
self,
373-
sock: socket.socket,
372+
sock: _socket.socket,
374373
server_side: bool = False,
375374
do_handshake_on_connect: bool = True,
376375
suppress_ragged_eofs: bool = True,

0 commit comments

Comments
 (0)