Scrapy, a fast high-level web crawling & scraping framework for Python.
remove deprecation warning for spider.user_agent attribute
Pablo Hoffman13cd9a1b0fda
diff --git a/scrapy/contrib/downloadermiddleware/useragent.py b/scrapy/contrib/downloadermiddleware/useragent.pyindex 752a8577b..42d60f7cf 100644--- a/scrapy/contrib/downloadermiddleware/useragent.py+++ b/scrapy/contrib/downloadermiddleware/useragent.py@@ -1,7 +1,6 @@"""Set User-Agent header per spider or use a default value from settings"""from scrapy.utils.python import WeakKeyCache-from scrapy.utils import deprecateclass UserAgentMiddleware(object):@@ -12,7 +11,6 @@ class UserAgentMiddleware(object):def _user_agent(self, spider):if hasattr(spider, 'user_agent'):- deprecate.attribute(spider, 'user_agent', 'USER_AGENT')return spider.user_agentreturn spider.settings['USER_AGENT']