mirror of https://github.com/scrapy/scrapy.git
fixed deprecation warnings
This commit is contained in:
parent
acf08cb7a2
commit
f80b8514b9
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue