mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-26 15:24:12 +00:00
add typecheck of funcs in ExtractorField.__init__
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40887
This commit is contained in:
parent
edf5dfb264
commit
65e8be46bc
@ -37,6 +37,10 @@ class ItemExtractor(object):
|
||||
|
||||
class ExtractorField(object):
|
||||
def __init__(self, funcs):
|
||||
if not hasattr(funcs, '__iter__'):
|
||||
raise TypeError(
|
||||
'You must initialize ExtractorField with a list of callables')
|
||||
|
||||
self._funcs = []
|
||||
|
||||
for func in funcs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user