Skip to content

Commit

Permalink
Merge pull request #839 from sglvladi/fix_repr_walrus_operator_bug
Browse files Browse the repository at this point in the history
Fix bug in BaseRepr.whitespace_remove() walrus expression
  • Loading branch information
sdhiscocks committed Aug 21, 2023
2 parents 8c4fcf2 + b7ae19a commit cb35415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stonesoup/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb35415

Please sign in to comment.