|
|
| 31 |
else: |
31 |
else: |
| 32 |
dev_null = open("/dev/null", "w") |
32 |
dev_null = open("/dev/null", "w") |
| 33 |
|
33 |
|
|
|
34 |
fcntl = fd = fl = None |
| 35 |
try: |
| 36 |
import fcntl |
| 37 |
fd = dev_null.fileno() |
| 38 |
fl = fcntl.fcntl(fd, fcntl.F_GETFD) |
| 39 |
fcntl.fcntl(fd, fcntl.F_SETFD, fl | fcntl.FD_CLOEXEC) |
| 40 |
except: |
| 41 |
pass |
| 42 |
del fcntl, fd, fl |
| 43 |
|
| 34 |
def _open_out_file(filename): |
44 |
def _open_out_file(filename): |
| 35 |
if filename in ['NUL:', '/dev/null']: |
45 |
if filename in ['NUL:', '/dev/null']: |
| 36 |
return dev_null |
46 |
return dev_null |