()
| 1137 | def _check_warn_on_dealloc_fd(self, *args, **kwargs): |
| 1138 | fds = [] |
| 1139 | def cleanup_fds(): |
| 1140 | for fd in fds: |
| 1141 | try: |
| 1142 | os.close(fd) |
| 1143 | except OSError as e: |
| 1144 | if e.errno != errno.EBADF: |
| 1145 | raise |
| 1146 | self.addCleanup(cleanup_fds) |
| 1147 | r, w = os.pipe() |
| 1148 | fds += r, w |