From d519696672bd644f78c99fa5648c22f5dd782149 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 23 Feb 2010 18:12:22 -0500 Subject: [PATCH 1/2] Whitespace fix --- eventlet/green/subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventlet/green/subprocess.py b/eventlet/green/subprocess.py index 293daa4..e3210a8 100644 --- a/eventlet/green/subprocess.py +++ b/eventlet/green/subprocess.py @@ -68,7 +68,7 @@ class Popen(subprocess_orig.Popen): # Borrow subprocess.call() and check_call(), but patch them so they reference # 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()) except AttributeError: From ef568ce6b1f8c9d44c1c0263022dadc683988b75 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 23 Feb 2010 22:53:19 -0500 Subject: [PATCH 2/2] Dropped keyword arg so that we don't use main_wrapper in GreenPool.spawn_n --- eventlet/greenpool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eventlet/greenpool.py b/eventlet/greenpool.py index 479027e..ca65401 100644 --- a/eventlet/greenpool.py +++ b/eventlet/greenpool.py @@ -83,7 +83,7 @@ class GreenPool(object): gt.link(self._spawn_done) return gt - def _spawn_n_impl(self, func, args, kwargs, coro=None): + def _spawn_n_impl(self, func, args, kwargs, coro): try: try: func(*args, **kwargs) @@ -108,11 +108,11 @@ class GreenPool(object): # itself -- instead, just execute in the current coroutine current = greenthread.getcurrent() if self.sem.locked() and current in self.coroutines_running: - self._spawn_n_impl(function, args, kwargs) + self._spawn_n_impl(function, args, kwargs, None) else: self.sem.acquire() g = greenthread.spawn_n(self._spawn_n_impl, - function, args, kwargs, coro=True) + function, args, kwargs, True) if not self.coroutines_running: self.no_coros_running = event.Event() self.coroutines_running.add(g)