Refs #27795 -- Removed unneeded force_text calls

Thanks Tim Graham for the review.
This commit is contained in:
Claude Paroz 2017-03-04 15:47:49 +01:00
parent 86de930f41
commit 8346680e1c
42 changed files with 75 additions and 132 deletions

View file

@ -38,8 +38,6 @@ def wrap(text, width):
Don't wrap long words, thus the output text may have lines longer than
``width``.
"""
text = force_text(text)
def _generator():
for line in text.splitlines(True): # True keeps trailing linebreaks
max_width = min((line.endswith('\n') and width + 1 or width), width)
@ -71,7 +69,6 @@ class Truncator(SimpleLazyObject):
truncate = pgettext(
'String to return when truncating text',
'%(truncated_text)s...')
truncate = force_text(truncate)
if '%(truncated_text)s' in truncate:
return truncate % {'truncated_text': text}
# The truncation text didn't contain the %(truncated_text)s string