Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Flake8: remove E111

Eugenio Lacuesta81d0b2f61ac1
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)