Skip to content

Commit

Permalink
remove deprecation warning for spider.user_agent attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohoffman committed Oct 22, 2011
1 parent 43b79af commit 13cd9a1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions 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 deprecate


class UserAgentMiddleware(object):
Expand All @@ -12,7 +11,6 @@ def __init__(self):

def _user_agent(self, spider):
if hasattr(spider, 'user_agent'):
deprecate.attribute(spider, 'user_agent', 'USER_AGENT')
return spider.user_agent
return spider.settings['USER_AGENT']

Expand Down

0 comments on commit 13cd9a1

Please sign in to comment.