fixed deprecation warnings

This commit is contained in:
Umair Ashraf 2016-05-16 13:44:42 -04:00 committed by Umair Ashraf
parent acf08cb7a2
commit f80b8514b9
2 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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)