From ba6b31a4366b10dd23172c9aebbbbe36264fc4ac Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 23 Jul 2010 16:47:05 -0700 Subject: [PATCH] A wrapper method to correctly handle the default value for input on 2.4. --- eventlet/green/subprocess.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eventlet/green/subprocess.py b/eventlet/green/subprocess.py index 9f20a44..50e119b 100644 --- a/eventlet/green/subprocess.py +++ b/eventlet/green/subprocess.py @@ -59,8 +59,10 @@ class Popen(subprocess_orig.Popen): globals()) except AttributeError: # 2.4 only has communicate - communicate = new.function(subprocess_orig.Popen.communicate.im_func.func_code, + _communicate = new.function(subprocess_orig.Popen.communicate.im_func.func_code, globals()) + def communicate(self, input=None): + return self._communicate(input) # Borrow subprocess.call() and check_call(), but patch them so they reference # OUR Popen class rather than subprocess.Popen.