diff --git a/docs/conf.py b/docs/conf.py index 6985e38fe..8f706c96c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,7 +3,6 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -# pylint: disable=import-error import os import sys from collections.abc import Sequence diff --git a/scrapy/core/engine.py b/scrapy/core/engine.py index ddfbb8fba..966b4b691 100644 --- a/scrapy/core/engine.py +++ b/scrapy/core/engine.py @@ -269,6 +269,7 @@ class ExecutionEngine: self._slot.nextcall.schedule() return except CloseSpider as exception: + assert self.spider is not None # typing self.close_spider(self.spider, reason=exception.reason) return diff --git a/tests/test_closespider.py b/tests/test_closespider.py index d30c99ac2..d4551904f 100644 --- a/tests/test_closespider.py +++ b/tests/test_closespider.py @@ -120,7 +120,7 @@ class TestCloseSpider(TestCase): async def yield_seeds(self): raise CloseSpider("foo") - yield + yield # pylint: disable=unreachable close_reasons = []