Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fix the check for sync ITEM_PROCESSOR methods. (#7589)

Andrey Rakhmatullincd25ece58a55
diff --git a/scrapy/core/scraper.py b/scrapy/core/scraper.py
index e756d27eb..466ce656d 100644
--- a/scrapy/core/scraper.py
+++ b/scrapy/core/scraper.py
@@ -125,7 +125,7 @@ class Scraper:
def _check_deprecated_itemproc_method(self, method: str) -> None:
itemproc_cls = type(self.itemproc)
- if not hasattr(self.itemproc, "process_item_async"):
+ if not hasattr(self.itemproc, f"{method}_async"):
warnings.warn(
f"{global_object_name(itemproc_cls)} doesn't define a {method}_async() method,"
f" this is deprecated and the method will be required in future Scrapy versions.",