mirror of https://github.com/scrapy/scrapy.git
Solve issues
This commit is contained in:
parent
170028d942
commit
86f56805e2
|
|
@ -61,14 +61,13 @@ def iter_spider_classes(
|
|||
:attr:`~scrapy.Spider.name` is also excluded.
|
||||
"""
|
||||
for obj in vars(module).values():
|
||||
if (
|
||||
inspect.isclass(obj)
|
||||
and issubclass(obj, Spider)
|
||||
and obj.__module__ == module.__name__
|
||||
and not obj._is_ignored()
|
||||
and (not require_name or getattr(obj, "name", None))
|
||||
):
|
||||
yield obj
|
||||
if not inspect.isclass(obj) or not issubclass(obj, Spider):
|
||||
continue
|
||||
if obj.__module__ != module.__name__ or obj._is_ignored():
|
||||
continue
|
||||
if require_name and not getattr(obj, "name", None):
|
||||
continue
|
||||
yield obj
|
||||
|
||||
|
||||
@overload
|
||||
|
|
|
|||
4
tox.ini
4
tox.ini
|
|
@ -111,7 +111,9 @@ commands =
|
|||
pre-commit run {posargs:--all-files}
|
||||
|
||||
[testenv:pylint]
|
||||
basepython = python3
|
||||
# Version-dependent code and pylint suppressions require a fixed interpreter.
|
||||
# Keep in sync with the pylint job in .github/workflows/checks.yml.
|
||||
basepython = python3.14
|
||||
deps =
|
||||
{[testenv:extra-deps]deps}
|
||||
pylint==4.0.6
|
||||
|
|
|
|||
Loading…
Reference in New Issue