Skip to content

Commit cc436d8

Browse files
committed
Small fix to truncation
1 parent d710aa5 commit cc436d8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bot/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def __iter__(self):
172172
'type': 'EndTag',
173173
'name': tag
174174
}
175-
yield from iter(self.truncated_message)
175+
yield from iter(self.truncated_message)
176176
break
177177
if token['type'] in ('Characters', 'SpaceCharacters'):
178178
if (current_length + len(token['data'])) > self.max_length:
@@ -185,8 +185,7 @@ def __iter__(self):
185185
'type': 'EndTag',
186186
'name': tag
187187
}
188-
for token2 in iter(self.truncated_message):
189-
yield token2
188+
yield from iter(self.truncated_message)
190189
break
191190
else:
192191
current_length += len(token['data'])
@@ -200,8 +199,7 @@ def __iter__(self):
200199

201200
yield token
202201

203-
for token in iter(self.suffix):
204-
yield token
202+
yield from iter(self.suffix)
205203

206204

207205
def truncate(html, truncated_message, suffix):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy