When a spider get parameter from settings, there's a duplicate type checking show as follow.
if self.redis_batch_size is None:
self.redis_batch_size = settings.getint('CONCURRENT_REQUESTS', defaults.REDIS_CONCURRENT_REQUESTS)
try:
self.redis_batch_size = int(self.redis_batch_size)
except (TypeError, ValueError):
raise ValueError("redis_batch_size must be an integer")
Description
When a spider get parameter from settings, there's a duplicate type checking show as follow.
code sample: spiders.py
Solution
Since showing an error message is recommended code style, then replace
getint
orgetxxx
toget
can do the job.