From 2a643b317c06974a55cd3545a2ed62f5ee57cda2 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Wed, 7 Jun 2023 15:12:52 -0400 Subject: [PATCH] Suppress exception context describing a cache miss Refs pylint-dev/pylint#8716 --- astroid/inference_tip.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astroid/inference_tip.py b/astroid/inference_tip.py index 9eda5b4fc7..cb1fb37909 100644 --- a/astroid/inference_tip.py +++ b/astroid/inference_tip.py @@ -65,6 +65,9 @@ def inner( result = _cache[func, node, context] = list( func(node, context, **kwargs) ) + except Exception as e: + # Suppress the KeyError from the cache miss. + raise e from None finally: # Remove recursion guard. try: