Fixed #12337, leaking pipe after gorge (#12339)

This commit is contained in:
Ico Doornekamp 2019-10-03 06:48:31 +02:00 • committed by Varriount
commit 982086dbe9

View file

@ -40,6 +40,7 @@ proc opGorge*(cmd, input, cache: string, info: TLineInfo; conf: ConfigRef): (str
p.inputStream.write(input) p.inputStream.write(input)
p.inputStream.close() p.inputStream.close()
result = p.readOutput result = p.readOutput
p.close()
readSuccessful = true readSuccessful = true
# only cache successful runs: # only cache successful runs:
if result[1] == 0: if result[1] == 0:
@ -54,5 +55,6 @@ proc opGorge*(cmd, input, cache: string, info: TLineInfo; conf: ConfigRef): (str
p.inputStream.write(input) p.inputStream.write(input)
p.inputStream.close() p.inputStream.close()
result = p.readOutput result = p.readOutput
p.close()
except IOError, OSError: except IOError, OSError:
result = ("", -1) result = ("", -1)