MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _create_socket

Method _create_socket

tools/python-3.11.9-amd64/Lib/imaplib.py:291–302  ·  view source on GitHub ↗
(self, timeout)

Source from the content-addressed store, hash-verified

289
290
291 def _create_socket(self, timeout):
292 # Default value of IMAP4.host is '', but socket.getaddrinfo()
293 # (which is used by socket.create_connection()) expects None
294 # as a default value for host.
295 if timeout is not None and not timeout:
296 raise ValueError('Non-blocking socket (timeout=0) is not supported')
297 host = None if not self.host else self.host
298 sys.audit("imaplib.open", self, self.host, self.port)
299 address = (host, self.port)
300 if timeout is not None:
301 return socket.create_connection(address, timeout)
302 return socket.create_connection(address)
303
304 def open(self, host='', port=IMAP4_PORT, timeout=None):
305 """Setup connection to remote server on "host:port"

Callers 2

openMethod · 0.95
_create_socketMethod · 0.45

Calls 1

create_connectionMethod · 0.45

Tested by

no test coverage detected