|
17 | 17 |
|
18 | 18 | import types
|
19 | 19 | import warnings
|
20 |
| -from typing import Optional, Union |
| 20 | +from typing import Any, Optional, Union |
21 | 21 |
|
22 | 22 | from pymongo.errors import ConfigurationError
|
23 | 23 |
|
|
56 | 56 |
|
57 | 57 | if HAVE_PYSSL:
|
58 | 58 | 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 |
63 | 63 | else:
|
64 | 64 | HAS_SNI = _ssl.HAS_SNI
|
65 |
| - SSLError = _ssl.SSLError |
| 65 | + PYSSLError = _ssl.SSLError |
66 | 66 | BLOCKING_IO_ERRORS = _ssl.BLOCKING_IO_ERRORS
|
67 | 67 | BLOCKING_IO_READ_ERROR = _ssl.BLOCKING_IO_READ_ERROR
|
68 | 68 | BLOCKING_IO_WRITE_ERROR = _ssl.BLOCKING_IO_WRITE_ERROR
|
| 69 | + SSLError = _ssl.SSLError |
69 | 70 | BLOCKING_IO_LOOKUP_ERROR = BLOCKING_IO_READ_ERROR
|
70 | 71 |
|
71 | 72 | def get_ssl_context(
|
@@ -125,7 +126,7 @@ class SSLError(Exception): # type: ignore
|
125 | 126 |
|
126 | 127 | HAS_SNI = False
|
127 | 128 | IPADDR_SAFE = False
|
128 |
| - BLOCKING_IO_ERRORS = () # type:ignore[assignment] |
| 129 | + BLOCKING_IO_ERRORS = () |
129 | 130 |
|
130 | 131 | def get_ssl_context(*dummy): # type: ignore
|
131 | 132 | """No ssl module, raise ConfigurationError."""
|
|
0 commit comments