Skip to content

Commit

Permalink
Merge 433ed77 into 3c5ff57
Browse files Browse the repository at this point in the history
  • Loading branch information
PCManticore committed Dec 27, 2020
2 parents 3c5ff57 + 433ed77 commit 80e440a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -75,6 +75,11 @@ Release Date: TBA

Close #835

* Fix a crash in functools.partial inference when the arguments cannot be determined

Close PyCQA/pylint#3776


What's New in astroid 2.4.3?
============================
Release Date: TBA
Expand Down
13 changes: 8 additions & 5 deletions astroid/brain/brain_functools.py
Expand Up @@ -86,11 +86,14 @@ def _functools_partial_inference(node, context=None):

# Determine if the passed keywords into the callsite are supported
# by the wrapped function.
function_parameters = chain(
inferred_wrapped_function.args.args or (),
inferred_wrapped_function.args.posonlyargs or (),
inferred_wrapped_function.args.kwonlyargs or (),
)
if not inferred_wrapped_function.args:
function_parameters = []
else:
function_parameters = chain(
inferred_wrapped_function.args.args or (),
inferred_wrapped_function.args.posonlyargs or (),
inferred_wrapped_function.args.kwonlyargs or (),
)
parameter_names = set(
param.name
for param in function_parameters
Expand Down

0 comments on commit 80e440a

Please sign in to comment.