Skip to content

Commit 0f5349e

Browse files
authored
PYTHON-4572 - Fix type errors caused by new PyOpenSSL type hints (mongodb#1743)
1 parent 993171c commit 0f5349e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymongo/pyopenssl_context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def load_cert_chain(
292292
# Password callback MUST be set first or it will be ignored.
293293
if password:
294294

295-
def _pwcb(_max_length: int, _prompt_twice: bool, _user_data: bytes) -> bytes:
295+
def _pwcb(_max_length: int, _prompt_twice: bool, _user_data: Optional[bytes]) -> bytes:
296296
# XXX:We could check the password length against what OpenSSL
297297
# tells us is the max, but we can't raise an exception, so...
298298
# warn?
@@ -332,6 +332,7 @@ def _load_certifi(self) -> None:
332332
def _load_wincerts(self, store: str) -> None:
333333
"""Attempt to load CA certs from Windows trust store."""
334334
cert_store = self._ctx.get_cert_store()
335+
assert cert_store is not None
335336
oid = _stdlibssl.Purpose.SERVER_AUTH.oid
336337

337338
for cert, encoding, trust in _stdlibssl.enum_certificates(store): # type: ignore

0 commit comments

Comments
 (0)