Create an invalid file descriptor by opening and closing a file and return its fd.
()
| 157 | |
| 158 | |
| 159 | def make_bad_fd(): |
| 160 | """ |
| 161 | Create an invalid file descriptor by opening and closing a file and return |
| 162 | its fd. |
| 163 | """ |
| 164 | file = open(TESTFN, "wb") |
| 165 | try: |
| 166 | return file.fileno() |
| 167 | finally: |
| 168 | file.close() |
| 169 | unlink(TESTFN) |
| 170 | |
| 171 | |
| 172 | _can_symlink = None |
searching dependent graphs…