Don't attempt to wrap GreenPipes in GreenPipe
If the os module is monkeypatched, Python's standard subprocess module will return greenio.GreenPipe instances for Popen objects' stdin, stdout, and stderr attributes. However, eventlet.green.subprocess tries to wrap these attributes in another greenio.GreenPipe, which GreenPipe refuses.
This commit is contained in:
@@ -27,7 +27,7 @@ class Popen(subprocess_orig.Popen):
|
||||
# eventlet.processes.Process.run() method.
|
||||
for attr in "stdin", "stdout", "stderr":
|
||||
pipe = getattr(self, attr)
|
||||
if pipe is not None:
|
||||
if pipe is not None and not type(pipe) == greenio.GreenPipe:
|
||||
wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
|
||||
setattr(self, attr, wrapped_pipe)
|
||||
__init__.__doc__ = subprocess_orig.Popen.__init__.__doc__
|
||||
|
Reference in New Issue
Block a user