(self, timeout)
| 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" |
no test coverage detected