From feafcb83cf5b379cdb7613f48268a7525a591f40 Mon Sep 17 00:00:00 2001 From: Nick Drozd Date: Fri, 19 May 2023 08:37:54 -0400 Subject: [PATCH] Check for call context in `PartialFunction.infer_call_result` (#2098) --- astroid/objects.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astroid/objects.py b/astroid/objects.py index f1e4cb69d2..3ef92b6cdf 100644 --- a/astroid/objects.py +++ b/astroid/objects.py @@ -314,6 +314,9 @@ def infer_call_result( context: InferenceContext | None = None, ) -> Iterator[InferenceResult]: if context: + assert ( + context.callcontext + ), "CallContext should be set before inferring call result" current_passed_keywords = { keyword for (keyword, _) in context.callcontext.keywords }