Skip to content

Commit

Permalink
Merge pull request #14 from redapple/has-key-in
Browse files Browse the repository at this point in the history
Use "key in dict" idiom instead of .has_key(key)
  • Loading branch information
redapple authored Dec 7, 2016
2 parents a4b9fdc + b392b8d commit c409d60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrapy_deltafetch/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def process_spider_output(self, response, result, spider):
for r in result:
if isinstance(r, Request):
key = self._get_key(r)
if self.db.has_key(key):
if key in self.db:
logger.info("Ignoring already visited: %s" % r)
if self.stats:
self.stats.inc_value('deltafetch/skipped', spider=spider)
Expand Down

0 comments on commit c409d60

Please sign in to comment.