mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-25 14:03:41 +00:00
added deprecation warning to ErrorPages downloader middleware
This commit is contained in:
parent
1aac694343
commit
0f690b03dc
@ -1,3 +1,5 @@
|
||||
import warnings
|
||||
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.utils.response import response_status_message
|
||||
|
||||
@ -8,6 +10,10 @@ class ErrorPagesMiddleware(object):
|
||||
TODO: move this mw to spidermiddleware and remove me
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
warnings.warn("scrapy.contrib.downloadermiddleware.errorpages.ErrorPagesMiddleware downloader middleware is deprecated - use scrapy.contrib.spidermiddleware.httperror.HttpErrorMiddleware spider middleware instead",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
def process_response(self, request, response, spider):
|
||||
status = response.status
|
||||
if 200 <= status < 300 or status in getattr(spider, 'handle_httpstatus_list', []):
|
||||
|
Loading…
x
Reference in New Issue
Block a user