Merge
This commit is contained in:
@@ -58,10 +58,18 @@ class Popen(subprocess_orig.Popen):
|
|||||||
# don't want to rewrite the original _communicate() method, we
|
# don't want to rewrite the original _communicate() method, we
|
||||||
# just want a version that uses eventlet.green.select.select()
|
# just want a version that uses eventlet.green.select.select()
|
||||||
# instead of select.select().
|
# instead of select.select().
|
||||||
|
try:
|
||||||
_communicate = new.function(subprocess_orig.Popen._communicate.im_func.func_code,
|
_communicate = new.function(subprocess_orig.Popen._communicate.im_func.func_code,
|
||||||
globals())
|
globals())
|
||||||
|
except AttributeError:
|
||||||
|
# 2.4 only has communicate
|
||||||
|
communicate = new.function(subprocess_orig.Popen.communicate.im_func.func_code,
|
||||||
|
globals())
|
||||||
|
|
||||||
# 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.
|
||||||
call = new.function(subprocess_orig.call.func_code, globals())
|
call = new.function(subprocess_orig.call.func_code, globals())
|
||||||
|
try:
|
||||||
check_call = new.function(subprocess_orig.check_call.func_code, globals())
|
check_call = new.function(subprocess_orig.check_call.func_code, globals())
|
||||||
|
except AttributeError:
|
||||||
|
pass # check_call added in 2.5
|
||||||
|
|||||||
Reference in New Issue
Block a user