Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fixed bug with deferred spider queues. Closes #288

Pablo Hoffman5ded8251d21e
diff --git a/scrapy/queue.py b/scrapy/queue.py
index 577555ece..2f2a17de5 100644
--- a/scrapy/queue.py
+++ b/scrapy/queue.py
@@ -16,12 +16,13 @@ class ExecutionQueue(object):
self._queue = queue
self._keepalive = keep_alive
+ @defer.inlineCallbacks
def _append_next(self):
"""Called when there are no more items left in self.spider_requests.
This method is meant to be overriden in subclasses to add new (spider,
requests) tuples to self.spider_requests. It can return a Deferred.
"""
- msg = self._queue.pop()
+ msg = yield self._queue.pop()
if msg:
name = msg.pop('name')
msg = stringify_dict(msg) # see #250