Scrapy, a fast high-level web crawling & scraping framework for Python.
Fix deprecation of scrapy.pipelines.images.NoimagesDrop
PluT009f659bd63c04
diff --git a/scrapy/pipelines/images.py b/scrapy/pipelines/images.pyindex df4575a41..c7a04a0cf 100644--- a/scrapy/pipelines/images.py+++ b/scrapy/pipelines/images.py@@ -5,25 +5,28 @@ See documentation in topics/media-pipeline.rst"""import functoolsimport hashlib+import warningsfrom contextlib import suppressfrom io import BytesIOfrom itemadapter import ItemAdapter-from scrapy.exceptions import DropItem, NotConfigured+from scrapy.exceptions import DropItem, NotConfigured, ScrapyDeprecationWarningfrom scrapy.http import Requestfrom scrapy.pipelines.files import FileException, FilesPipeline# TODO: from scrapy.pipelines.media import MediaPipelinefrom scrapy.settings import Settings-from scrapy.utils.decorators import deprecatedfrom scrapy.utils.misc import md5sumfrom scrapy.utils.python import to_bytes-@deprecated()class NoimagesDrop(DropItem):"""Product with no images exception"""+ def __init__(self, *args, **kwargs):+ warnings.warn("The NoimagesDrop class is deprecated", category=ScrapyDeprecationWarning, stacklevel=2)+ super().__init__(*args, **kwargs)+class ImageException(FileException):"""General image error exception"""