(self, sock)
| 460 | fut.add_done_callback(cb) |
| 461 | |
| 462 | def _stop_serving(self, sock): |
| 463 | # Is this a unix socket that needs cleanup? |
| 464 | if sock in self._unix_server_sockets: |
| 465 | path = sock.getsockname() |
| 466 | else: |
| 467 | path = None |
| 468 | |
| 469 | super()._stop_serving(sock) |
| 470 | |
| 471 | if path is not None: |
| 472 | prev_ino = self._unix_server_sockets[sock] |
| 473 | del self._unix_server_sockets[sock] |
| 474 | try: |
| 475 | if os.stat(path).st_ino == prev_ino: |
| 476 | os.unlink(path) |
| 477 | except FileNotFoundError: |
| 478 | pass |
| 479 | except OSError as err: |
| 480 | logger.error('Unable to clean up listening UNIX socket ' |
| 481 | '%r: %r', path, err) |
| 482 | |
| 483 | |
| 484 | class _UnixReadPipeTransport(transports.ReadTransport): |
nothing calls this directly
no test coverage detected