From 4345eaf1b640bfecb2340a0e27649b1ab1079da6 Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Fri, 17 Mar 2017 08:11:20 +0100 Subject: [PATCH] [logformatter] backward compat comments --- scrapy/logformatter.py | 1 + tests/test_logformatter.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scrapy/logformatter.py b/scrapy/logformatter.py index 2a89c00c5..075a6d862 100644 --- a/scrapy/logformatter.py +++ b/scrapy/logformatter.py @@ -43,6 +43,7 @@ class LogFormatter(object): 'request_flags' : request_flags, 'referer': referer_str(request), 'response_flags': response_flags, + # backward compatibility with Scrapy logformatter below 1.4 version 'flags': response_flags } } diff --git a/tests/test_logformatter.py b/tests/test_logformatter.py index 52646ec1b..94e6c9fde 100644 --- a/tests/test_logformatter.py +++ b/tests/test_logformatter.py @@ -66,7 +66,6 @@ class LoggingContribTest(unittest.TestCase): class LogFormatterSubclass(LogFormatter): - # Formatter with format spec that is same as in Scrapy before 1.3 version. def crawled(self, request, response, spider): kwargs = super(LogFormatterSubclass, self).crawled( request, response, spider) @@ -82,7 +81,6 @@ class LogFormatterSubclass(LogFormatter): class LogformatterSubclassTest(LoggingContribTest): - # Test if old crawledmsg format string still works fine def setUp(self): self.formatter = LogFormatterSubclass() self.spider = Spider('default')