From d561b676409b428fc3b2c4e500359eb099f445dc Mon Sep 17 00:00:00 2001 From: big1hc <134590104+big1hc@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:24:43 +0700 Subject: [PATCH] Update sphinx_needs/filter_common.py Co-authored-by: Chris Sewell --- sphinx_needs/filter_common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sphinx_needs/filter_common.py b/sphinx_needs/filter_common.py index 4f28c261f..e91a415f7 100644 --- a/sphinx_needs/filter_common.py +++ b/sphinx_needs/filter_common.py @@ -344,9 +344,8 @@ def filter_single_need( else: result = eval(filter_string, filter_context) if not isinstance(result, bool): - # Raises NeedsInvalidFilter if the result is a string type raise NeedsInvalidFilter( - f"Error when evaluating filter: expected output to have True/False but got a string <{result}>" + f"Filter did not evaluate to a boolean, instead {type(result)}: {result}" ) except Exception as e: raise NeedsInvalidFilter(f"Filter {filter_string} not valid. Error: {e}.")