kill ancient capture devnullpath, os.devnull exists since py 2.4
This commit is contained in:
parent
d1a9ab3df0
commit
b4a397d153
|
@ -331,7 +331,7 @@ class FDCapture:
|
||||||
"saved filedescriptor not valid, "
|
"saved filedescriptor not valid, "
|
||||||
"did you call start() twice?")
|
"did you call start() twice?")
|
||||||
if self.targetfd == 0 and not self.tmpfile:
|
if self.targetfd == 0 and not self.tmpfile:
|
||||||
fd = os.open(devnullpath, os.O_RDONLY)
|
fd = os.open(os.devnull, os.O_RDONLY)
|
||||||
os.dup2(fd, 0)
|
os.dup2(fd, 0)
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
if hasattr(self, '_oldsys'):
|
if hasattr(self, '_oldsys'):
|
||||||
|
@ -639,12 +639,3 @@ class DontReadFromInput:
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
devnullpath = os.devnull
|
|
||||||
except AttributeError:
|
|
||||||
if os.name == 'nt':
|
|
||||||
devnullpath = 'NUL'
|
|
||||||
else:
|
|
||||||
devnullpath = '/dev/null'
|
|
||||||
|
|
Loading…
Reference in New Issue