MCPcopy Index your code
hub / github.com/RustPython/RustPython / _create_socket

Method _create_socket

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

Source from the content-addressed store, hash-verified

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