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.
Type of Changes
Description
Came across an error while testing Home Assistant.
safe_infer
here assumes thatvalue
is aFunctionDef
to be able to accessvalue.args.args
. The assumption is never fully checked however.value
could also be an<Instance of builtins.function ...>
which would cause anAttributeError
.I wasn't able to write a dedicated regression test unfortunately. Home Assistant only managed to break it with some combination of patching a builtin function and custom plugins which import parts of the checked files itself.
The condition was originally added in #5409