Skip to content

Commit

Permalink
Update sphinx_needs/filter_common.py
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
  • Loading branch information
big1hc and chrisjsewell committed Sep 5, 2023
1 parent 33d64a5 commit d63b972
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions sphinx_needs/filter_common.py
Expand Up @@ -344,10 +344,7 @@ 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}>"
)
raise NeedsInvalidFilter(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}.")
return result

0 comments on commit d63b972

Please sign in to comment.