(self, fd)
| 435 | raise AssertionError(f'{handle._args!r} != {args!r}') |
| 436 | |
| 437 | def _ensure_fd_no_transport(self, fd): |
| 438 | if not isinstance(fd, int): |
| 439 | try: |
| 440 | fd = int(fd.fileno()) |
| 441 | except (AttributeError, TypeError, ValueError): |
| 442 | # This code matches selectors._fileobj_to_fd function. |
| 443 | raise ValueError("Invalid file object: " |
| 444 | "{!r}".format(fd)) from None |
| 445 | try: |
| 446 | transport = self._transports[fd] |
| 447 | except KeyError: |
| 448 | pass |
| 449 | else: |
| 450 | raise RuntimeError( |
| 451 | 'File descriptor {!r} is used by transport {!r}'.format( |
| 452 | fd, transport)) |
| 453 | |
| 454 | def add_reader(self, fd, callback, *args): |
| 455 | """Add a reader callback.""" |
no test coverage detected