From 81d0b2f61ac119efab4d5970bd235dbc288496ef Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Fri, 8 May 2020 16:23:53 -0300 Subject: [PATCH] Flake8: remove E111 --- pytest.ini | 4 ++-- scrapy/selector/unified.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pytest.ini b/pytest.ini index 604bbfe1d..20639baa3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -102,7 +102,7 @@ flake8-ignore = scrapy/pipelines/media.py E501 # scrapy/selector scrapy/selector/__init__.py F403 - scrapy/selector/unified.py E501 E111 + scrapy/selector/unified.py E501 # scrapy/settings scrapy/settings/__init__.py E501 scrapy/settings/default_settings.py E501 E114 E116 @@ -224,7 +224,7 @@ flake8-ignore = tests/test_spider.py E501 tests/test_spidermiddleware.py E501 tests/test_spidermiddleware_httperror.py E128 E501 E121 - tests/test_spidermiddleware_offsite.py E501 E128 E111 + tests/test_spidermiddleware_offsite.py E501 E128 tests/test_spidermiddleware_output_chain.py E501 tests/test_spidermiddleware_referer.py E501 F841 E501 E121 tests/test_squeues.py E501 E741 diff --git a/scrapy/selector/unified.py b/scrapy/selector/unified.py index a08955dc9..85a9bb526 100644 --- a/scrapy/selector/unified.py +++ b/scrapy/selector/unified.py @@ -65,9 +65,9 @@ class Selector(_ParselSelector, object_ref): selectorlist_cls = SelectorList def __init__(self, response=None, text=None, type=None, root=None, **kwargs): - if not(response is None or text is None): - raise ValueError('%s.__init__() received both response and text' - % self.__class__.__name__) + if response is not None and text is not None: + raise ValueError('%s.__init__() received both response and text' + % self.__class__.__name__) st = _st(response, type or self._default_type)