(fd_low, fd_high)
| 317 | from os import closerange |
| 318 | except ImportError: |
| 319 | def closerange(fd_low, fd_high): |
| 320 | # Iterate through and close all file descriptors. |
| 321 | for fd in range(fd_low, fd_high): |
| 322 | try: |
| 323 | os.close(fd) |
| 324 | except OSError: # ERROR, fd wasn't open to begin with (ignored) |
| 325 | pass |
| 326 | |
| 327 | |
| 328 | def write_chunk(sock, data): |