Close I/O established in "open".
(self)
| 333 | |
| 334 | |
| 335 | def shutdown(self): |
| 336 | """Close I/O established in "open".""" |
| 337 | self.file.close() |
| 338 | try: |
| 339 | self.sock.shutdown(socket.SHUT_RDWR) |
| 340 | except OSError as exc: |
| 341 | # The server might already have closed the connection. |
| 342 | # On Windows, this may result in WSAEINVAL (error 10022): |
| 343 | # An invalid operation was attempted. |
| 344 | if (exc.errno != errno.ENOTCONN |
| 345 | and getattr(exc, 'winerror', 0) != 10022): |
| 346 | raise |
| 347 | finally: |
| 348 | self.sock.close() |
| 349 | |
| 350 | |
| 351 | def socket(self): |