Solve issues

This commit is contained in:
Adrian Chaves 2026-07-31 21:27:33 +02:00
parent 170028d942
commit 86f56805e2
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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