mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
python: Replace silly uses of filter().
The test_management_commands use in particular was causing pickling errors when the test failed, because Python 3 filter returns an iterator, not a list. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
5c9d56d2f7
commit
d3e8af4ad2
@@ -497,10 +497,10 @@ def get_mobile_push_content(rendered_content: str) -> str:
|
||||
return elem.text or ''
|
||||
|
||||
def format_as_quote(quote_text: str) -> str:
|
||||
quote_text_list = filter(None, quote_text.split('\n')) # Remove empty lines
|
||||
quote_text = '\n'.join(map(lambda x: "> "+x, quote_text_list))
|
||||
quote_text += '\n'
|
||||
return quote_text
|
||||
return "".join(
|
||||
f"> {line}\n" for line in quote_text.splitlines()
|
||||
if line # Remove empty lines
|
||||
)
|
||||
|
||||
def render_olist(ol: lxml.html.HtmlElement) -> str:
|
||||
items = []
|
||||
|
||||
Reference in New Issue
Block a user