MCPcopy Index your code
hub / github.com/python/cpython / _create_socket

Method _create_socket

Lib/imaplib.py:294–305  ·  view source on GitHub ↗
(self, timeout)

Source from the content-addressed store, hash-verified

292
293
294 def _create_socket(self, timeout):
295 # Default value of IMAP4.host is '', but socket.getaddrinfo()
296 # (which is used by socket.create_connection()) expects None
297 # as a default value for host.
298 if timeout is not None and not timeout:
299 raise ValueError('Non-blocking socket (timeout=0) is not supported')
300 host = None if not self.host else self.host
301 sys.audit("imaplib.open", self, self.host, self.port)
302 address = (host, self.port)
303 if timeout is not None:
304 return socket.create_connection(address, timeout)
305 return socket.create_connection(address)
306
307 def open(self, host='', port=IMAP4_PORT, timeout=None):
308 """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