提交 37929f42 编写于 作者: P Pablo Hoffman

spider manager: added protection to avoid reloading non-spider modules

上级 11f296b7
......@@ -117,7 +117,9 @@ class TwistedPluginSpiderManager(object):
spider
"""
module_name = spider.__module__
log.msg("Reloading module %s" % module_name, domain=domain, \
level=log.DEBUG)
new_module = rebuild(sys.modules[module_name], doLog=0)
self._spiders[domain] = new_module.SPIDER
module = sys.modules[module_name]
if hasattr(module, 'SPIDER'):
log.msg("Reloading module %s" % module_name, domain=domain, \
level=log.DEBUG)
new_module = rebuild(module, doLog=0)
self._spiders[domain] = new_module.SPIDER
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册