Close I/O established in "open".
(self)
| 416 | |
| 417 | |
| 418 | def shutdown(self): |
| 419 | """Close I/O established in "open".""" |
| 420 | self._file.close() |
| 421 | try: |
| 422 | self.sock.shutdown(socket.SHUT_RDWR) |
| 423 | except OSError as exc: |
| 424 | # The server might already have closed the connection. |
| 425 | # On Windows, this may result in WSAEINVAL (error 10022): |
| 426 | # An invalid operation was attempted. |
| 427 | if (exc.errno != errno.ENOTCONN |
| 428 | and getattr(exc, 'winerror', 0) != 10022): |
| 429 | raise |
| 430 | finally: |
| 431 | self.sock.close() |
| 432 | |
| 433 | |
| 434 | def socket(self): |