diff options
author | Ross <rrhodes@users.noreply.github.com> | 2021-01-01 17:20:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-01 17:20:25 (GMT) |
commit | 3bf05327c2b25d42b92795d9d280288c22a0963d (patch) | |
tree | 608f0d4a616d760f154d4a8a73e837e5fc92fb30 /Lib/test/mock_socket.py | |
parent | de6f20a6de48d63066b2cf5b317f50629f01d74a (diff) | |
download | cpython-3bf05327c2b25d42b92795d9d280288c22a0963d.zip cpython-3bf05327c2b25d42b92795d9d280288c22a0963d.tar.gz cpython-3bf05327c2b25d42b92795d9d280288c22a0963d.tar.bz2 |
bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when timeout not provided (GH-23969)
Diffstat (limited to 'Lib/test/mock_socket.py')
-rw-r--r-- | Lib/test/mock_socket.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/mock_socket.py b/Lib/test/mock_socket.py index cda4db2..c7abddc 100644 --- a/Lib/test/mock_socket.py +++ b/Lib/test/mock_socket.py @@ -107,6 +107,9 @@ class MockSocket: def close(self): pass + def connect(self, host): + pass + def socket(family=None, type=None, proto=None): return MockSocket(family) @@ -152,8 +155,12 @@ error = socket_module.error # Constants +_GLOBAL_DEFAULT_TIMEOUT = socket_module._GLOBAL_DEFAULT_TIMEOUT AF_INET = socket_module.AF_INET AF_INET6 = socket_module.AF_INET6 SOCK_STREAM = socket_module.SOCK_STREAM SOL_SOCKET = None SO_REUSEADDR = None + +if hasattr(socket_module, 'AF_UNIX'): + AF_UNIX = socket_module.AF_UNIX |