mirror of https://github.com/scrapy/scrapy.git
arg_to_iter: replaced double call to isinstance with a single one. refs #248
This commit is contained in:
parent
2bbd92742b
commit
3a6b80259d
|
|
@ -233,6 +233,7 @@ class ExecutionEngine(object):
|
|||
next loop and this function is guaranteed to be called (at least) once
|
||||
again for this spider.
|
||||
"""
|
||||
print ">>> spider_idle!"
|
||||
res = self.signals.send_catch_log(signal=signals.spider_idle, \
|
||||
spider=spider, dont_log=DontCloseSpider)
|
||||
if any(isinstance(x, Failure) and isinstance(x.value, DontCloseSpider) \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from scrapy.utils import signal
|
|||
|
||||
class SignalManager(object):
|
||||
|
||||
def __init__(self, sender=dispatcher.Anonymous):
|
||||
def __init__(self, sender=dispatcher.Any):
|
||||
self.sender = sender
|
||||
|
||||
def connect(self, *a, **kw):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ def arg_to_iter(arg):
|
|||
"""
|
||||
if arg is None:
|
||||
return []
|
||||
elif not isinstance(arg, dict) and not isinstance(arg, BaseItem) and hasattr(arg, '__iter__'):
|
||||
elif not isinstance(arg, (dict, BaseItem)) and hasattr(arg, '__iter__'):
|
||||
return arg
|
||||
else:
|
||||
return [arg]
|
||||
|
|
|
|||
Loading…
Reference in New Issue