##// END OF EJS Templates
subprocession: limit fd leaks
marcink -
r624:560860c2 default
parent child Browse files
Show More
@@ -66,6 +66,7 b' class StreamFeeder(Thread):'
66 66
67 67 def run(self):
68 68 t = self.writeiface
69 try:
69 70 if self.bytes:
70 71 os.write(t, self.bytes)
71 72 else:
@@ -74,6 +75,7 b' class StreamFeeder(Thread):'
74 75 while b:
75 76 os.write(t, b)
76 77 b = s.read(4096)
78 finally:
77 79 os.close(t)
78 80
79 81 @property
@@ -436,6 +438,7 b' class SubprocessIOChunker(object):'
436 438 self.process = _p
437 439 self.output = bg_out
438 440 self.error = bg_err
441 self.inputstream = inputstream
439 442
440 443 def __iter__(self):
441 444 return self
@@ -484,6 +487,10 b' class SubprocessIOChunker(object):'
484 487 self.error.close()
485 488 except:
486 489 pass
490 try:
491 os.close(self.inputstream)
492 except:
493 pass
487 494
488 495 def __del__(self):
489 496 self.close()
General Comments 0
You need to be logged in to leave comments. Login now