From e7acc2171df5ea12b12066d159b8c5d1f7e30131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Tue, 4 Jun 2013 17:28:43 -0300 Subject: [PATCH] show deprecation warning for HttpDownloadHandler --- scrapy/core/downloader/handlers/http.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scrapy/core/downloader/handlers/http.py b/scrapy/core/downloader/handlers/http.py index 8d05907f1..1efebb939 100644 --- a/scrapy/core/downloader/handlers/http.py +++ b/scrapy/core/downloader/handlers/http.py @@ -8,4 +8,12 @@ else: # backwards compatibility -HttpDownloadHandler = HTTP10DownloadHandler +class HttpDownloadHandler(HTTP10DownloadHandler): + + def __init__(self, *args, **kwargs): + import warnings + from scrapy.exceptions import ScrapyDeprecationWarning + warnings.warn('HttpDownloadHandler is deprecated, import scrapy.core.downloader' + '.handlers.http10.HTTP10DownloadHandler instead', + category=ScrapyDeprecationWarning, stacklevel=1) + super(HttpDownloadHandler, self).__init__(*args, **kwargs)