Skip to content

Commit

Permalink
fixed leading whitespace in return string
Browse files Browse the repository at this point in the history
  • Loading branch information
hartmutobendorf committed Feb 21, 2024
1 parent b72a39e commit 8683607
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions babel/dates.py
Expand Up @@ -967,10 +967,10 @@ def _iter_patterns(a_unit):
if pattern is None:
return ''
if (depth=='shallow'):
formatted_string = ' '.join([formatted_string, pattern.replace('{0}', str(value))])
formatted_string = ' '.join(filter(None, [formatted_string, pattern.replace('{0}', str(value))]))
break
elif ((depth=='full' and value > 0) or depth == 'fullest'):
formatted_string = ' '.join([formatted_string, pattern.replace('{0}', str(value))])
formatted_string = ' '.join(filter(None, [formatted_string, pattern.replace('{0}', str(value))]))
seconds = seconds - value * secs_per_unit

Check warning on line 974 in babel/dates.py

View check run for this annotation

Codecov / codecov/patch

babel/dates.py#L972-L974

Added lines #L972 - L974 were not covered by tests

return formatted_string
Expand Down

0 comments on commit 8683607

Please sign in to comment.