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

Method _get_socket

Lib/smtplib.py:312–320  ·  view source on GitHub ↗
(self, host, port, timeout)

Source from the content-addressed store, hash-verified

310 print(*args, file=sys.stderr)
311
312 def _get_socket(self, host, port, timeout):
313 # This makes it simpler for SMTP_SSL to use the SMTP connect code
314 # and just alter the socket connection bit.
315 if timeout is not None and not timeout:
316 raise ValueError('Non-blocking socket (timeout=0) is not supported')
317 if self.debuglevel > 0:
318 self._print_debug('connect: to', (host, port), self.source_address)
319 return socket.create_connection((host, port), timeout,
320 self.source_address)
321
322 def connect(self, host='localhost', port=0, source_address=None):
323 """Connect to a host on a given port.

Callers 2

connectMethod · 0.95
_get_socketMethod · 0.45

Calls 2

_print_debugMethod · 0.95
create_connectionMethod · 0.45

Tested by

no test coverage detected