Scrapy, a fast high-level web crawling & scraping framework for Python.
Simplify the get_retry_request code example
Adrián Chaves94201612bcad
diff --git a/scrapy/downloadermiddlewares/retry.py b/scrapy/downloadermiddlewares/retry.pyindex 5e49a284a..2721db7cf 100644--- a/scrapy/downloadermiddlewares/retry.py+++ b/scrapy/downloadermiddlewares/retry.py@@ -55,14 +55,12 @@ def get_retry_request(def parse(self, response):if not response.text:- new_request = get_retry_request(+ new_request_or_none = get_retry_request(response.request,spider=self,reason='empty',)- if new_request:- yield new_request- return+ return new_request_or_none*spider* is the :class:`~scrapy.Spider` instance which is asking for theretry request. It is used to access the :ref:`settings <topics-settings>`