Skip to content

Commit

Permalink
FeedExporter.crawler always exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Apr 28, 2024
1 parent cb495f1 commit f5b65de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapy/extensions/feedexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def __init__(
spider: Spider,
exporters: Dict[str, Type[BaseItemExporter]],
settings: BaseSettings,
crawler: Optional[Crawler],
crawler: Crawler,
):
self.file: Optional[IO[bytes]] = None
self.exporter: Optional[BaseItemExporter] = None
Expand All @@ -420,7 +420,7 @@ def __init__(
self.spider: Spider = spider
self.exporters: Dict[str, Type[BaseItemExporter]] = exporters
self.settings: BaseSettings = settings
self.crawler: Optional[Crawler] = crawler
self.crawler: Crawler = crawler
# flags
self.itemcount: int = 0
self._exporting: bool = False
Expand Down Expand Up @@ -651,7 +651,7 @@ def _start_new_batch(
spider=spider,
exporters=self.exporters,
settings=self.settings,
crawler=cast(Optional[Crawler], getattr(self, "crawler", None)),
crawler=self.crawler,
)
return slot

Expand Down

0 comments on commit f5b65de

Please sign in to comment.