diff --git a/scrapy/contrib/downloadermiddleware/httpauth.py b/scrapy/contrib/downloadermiddleware/httpauth.py index 493a4cf6f..19fc303b5 100644 --- a/scrapy/contrib/downloadermiddleware/httpauth.py +++ b/scrapy/contrib/downloadermiddleware/httpauth.py @@ -1,7 +1,10 @@ import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.contrib.downloadermiddleware.httpauth` is deprecated, " - "use `scrapy.downloadermiddlewares.httpauth` instead", + "use `scrapy.downloadermiddlewares.auth` instead", ScrapyDeprecationWarning, stacklevel=2) -from scrapy.downloadermiddlewares.auth import AuthMiddleware as HttpAuthMiddleware +from scrapy.utils.deprecate import create_deprecated_class +from scrapy.downloadermiddlewares.auth import AuthMiddleware + +HttpAuthMiddleware = create_deprecated_class('HttpAuthMiddleware', AuthMiddleware) diff --git a/scrapy/downloadermiddlewares/httpauth.py b/scrapy/downloadermiddlewares/httpauth.py index 78adc8706..12b4372e5 100644 --- a/scrapy/downloadermiddlewares/httpauth.py +++ b/scrapy/downloadermiddlewares/httpauth.py @@ -4,4 +4,7 @@ warnings.warn("Module `scrapy.downloadermiddleware.httpauth` is deprecated, " "use `scrapy.downloadermiddlewares.auth` instead", ScrapyDeprecationWarning) -from scrapy.downloadermiddlewares.auth import AuthMiddleware as HttpAuthMiddleware +from scrapy.utils.deprecate import create_deprecated_class +from scrapy.downloadermiddlewares.auth import AuthMiddleware + +HttpAuthMiddleware = create_deprecated_class('HttpAuthMiddleware', AuthMiddleware)