A wrapper method to correctly handle the default value for input on 2.4.

This commit is contained in:
Ryan Williams
2010-07-23 16:47:05 -07:00
parent 8ef5160cc9
commit ba6b31a436

View File

@@ -59,8 +59,10 @@ class Popen(subprocess_orig.Popen):
globals()) globals())
except AttributeError: except AttributeError:
# 2.4 only has communicate # 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()) globals())
def communicate(self, input=None):
return self._communicate(input)
# Borrow subprocess.call() and check_call(), but patch them so they reference # Borrow subprocess.call() and check_call(), but patch them so they reference
# OUR Popen class rather than subprocess.Popen. # OUR Popen class rather than subprocess.Popen.