Skip to content

Commit 0b3c6bb

Browse files
committed
fix failures
1 parent ef4111e commit 0b3c6bb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pymongo/ssl_support.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import types
1919
import warnings
20-
from typing import Optional, Union
20+
from typing import Any, Optional, Union
2121

2222
from pymongo.errors import ConfigurationError
2323

@@ -56,16 +56,17 @@
5656

5757
if HAVE_PYSSL:
5858
HAS_SNI = _pyssl.HAS_SNI | _ssl.HAS_SNI
59-
SSLError = _pyssl.SSLError | _ssl.SSLError
60-
BLOCKING_IO_ERRORS = _pyssl.BLOCKING_IO_ERRORS | _ssl.BLOCKING_IO_ERRORS
61-
BLOCKING_IO_READ_ERROR = _pyssl.BLOCKING_IO_READ_ERROR | _ssl.BLOCKING_IO_READ_ERROR
62-
BLOCKING_IO_WRITE_ERROR = _pyssl.BLOCKING_IO_WRITE_ERROR | _ssl.BLOCKING_IO_WRITE_ERROR
59+
PYSSLError = _pyssl.SSLError
60+
BLOCKING_IO_ERRORS: Any = _pyssl.BLOCKING_IO_ERRORS + _ssl.BLOCKING_IO_ERRORS
61+
BLOCKING_IO_READ_ERROR: Any = _pyssl.BLOCKING_IO_READ_ERROR | _ssl.BLOCKING_IO_READ_ERROR
62+
BLOCKING_IO_WRITE_ERROR: Any = _pyssl.BLOCKING_IO_WRITE_ERROR | _ssl.BLOCKING_IO_WRITE_ERROR
6363
else:
6464
HAS_SNI = _ssl.HAS_SNI
65-
SSLError = _ssl.SSLError
65+
PYSSLError = _ssl.SSLError
6666
BLOCKING_IO_ERRORS = _ssl.BLOCKING_IO_ERRORS
6767
BLOCKING_IO_READ_ERROR = _ssl.BLOCKING_IO_READ_ERROR
6868
BLOCKING_IO_WRITE_ERROR = _ssl.BLOCKING_IO_WRITE_ERROR
69+
SSLError = _ssl.SSLError
6970
BLOCKING_IO_LOOKUP_ERROR = BLOCKING_IO_READ_ERROR
7071

7172
def get_ssl_context(
@@ -125,7 +126,7 @@ class SSLError(Exception): # type: ignore
125126

126127
HAS_SNI = False
127128
IPADDR_SAFE = False
128-
BLOCKING_IO_ERRORS = () # type:ignore[assignment]
129+
BLOCKING_IO_ERRORS = ()
129130

130131
def get_ssl_context(*dummy): # type: ignore
131132
"""No ssl module, raise ConfigurationError."""

0 commit comments

Comments
 (0)