Commit 452536b1 authored by Denis Bilenko's avatar Denis Bilenko

gevent/subprocess.py: prevent double close of a file descriptor

parent e3d395dd
...@@ -698,14 +698,13 @@ class Popen(object): ...@@ -698,14 +698,13 @@ class Popen(object):
# Wait for exec to fail or succeed; possibly raising exception # Wait for exec to fail or succeed; possibly raising exception
# Exception limited to 1M # Exception limited to 1M
data = FileObject(errpipe_read, 'rb').read(1048576) errpipe_read = FileObject(errpipe_read, 'rb')
errpipe_read = None data = errpipe_read.read(1048576)
finally: finally:
try: if hasattr(errpipe_read, 'close'):
if errpipe_read is not None: errpipe_read.close()
else:
os.close(errpipe_read) os.close(errpipe_read)
except EnvironmentError:
pass
if data != "": if data != "":
self.wait() self.wait()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment