PYTHON-3864 add types to socket_checker.py (#1323)

This commit is contained in:
Iris 2023-07-24 16:06:18 -07:00 committed by GitHub
parent efcbfbef8c
commit e4f1a35fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ _HAVE_POLL = hasattr(select, "poll") and not sys.platform.startswith("java")
_SelectError = getattr(select, "error", OSError)
def _errno_from_exception(exc):
def _errno_from_exception(exc: BaseException) -> Optional[int]:
if hasattr(exc, "errno"):
return exc.errno
if exc.args: