Fix decoratornames for decorators without qname#3118
Open
gaoflow wants to merge 1 commit into
Open
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3118 +/- ##
=======================================
Coverage 93.59% 93.59%
=======================================
Files 92 92
Lines 11371 11373 +2
=======================================
+ Hits 10643 10645 +2
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
DanielNoord
reviewed
Jun 28, 2026
DanielNoord
left a comment
Collaborator
There was a problem hiding this comment.
Please use isintance instead of getattr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qname()inFunctionDef.decoratornames()@slice(0), which currently infers aSlicenode and crashes while checking whether the function is a propertyFixes #3115.
Verification
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_regrtest.py::NonRegressionTests::test_decorator_names_inference_error_leaking tests/test_regrtest.py::NonRegressionTests::test_decorator_names_skip_inferred_nodes_without_qname tests/test_regrtest.py -qPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_scoped_nodes.py -quv run --with ruff ruff check astroid/nodes/scoped_nodes/scoped_nodes.py tests/test_regrtest.pyuv run --with black black --check astroid/nodes/scoped_nodes/scoped_nodes.py tests/test_regrtest.pypython -m compileall -q astroid/nodes/scoped_nodes/scoped_nodes.py tests/test_regrtest.pygit diff --checkI also tried a full local
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q; it reached1979 passedbut failed on local environment/optional dependency gaps (pytest-benchmarkfixture missing,pkg_resourcesmissing, numpy/pydantic brain expectations, and a symlink path test). The focused affected suites above pass.