mirror of
https://github.com/django/django.git
synced 2025-09-21 18:00:45 +00:00
Refs #27795 -- Removed unneeded force_text calls
Thanks Tim Graham for the review.
This commit is contained in:
parent
86de930f41
commit
8346680e1c
42 changed files with 75 additions and 132 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue