From b7ae19a16359f608bff3df7fb0b6b67eaeb355c1 Mon Sep 17 00:00:00 2001 From: sglvladi Date: Tue, 15 Aug 2023 14:48:33 +0100 Subject: [PATCH] Fix bug in BaseRepr.whitespace_remove() walrus expression --- stonesoup/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stonesoup/base.py b/stonesoup/base.py index e930a1b58..f68afa4fd 100644 --- a/stonesoup/base.py +++ b/stonesoup/base.py @@ -241,7 +241,7 @@ def whitespace_remove(cls, maxlen_whitespace, val): """Remove excess whitespace, replacing with ellipses""" large_whitespace = ' ' * (maxlen_whitespace+1) fixed_whitespace = ' ' * maxlen_whitespace - while excess := val.find(large_whitespace) != -1: # Find the excess whitespace, if any + while (excess := val.find(large_whitespace)) != -1: # Find the excess whitespace, if any line_end = ''.join(val[excess:].partition('\n')[1:]) val = ''.join([val[0:excess], fixed_whitespace, '...', line_end]) return val