mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
Use encode() in zerver/lib/tex.py.
This commit is contained in:
@@ -4,7 +4,6 @@ import os
|
||||
import subprocess
|
||||
from django.conf import settings
|
||||
from typing import Optional, Text
|
||||
from zerver.lib.str_utils import force_bytes
|
||||
|
||||
def render_tex(tex, is_inline=True):
|
||||
# type: (Text, bool) -> Optional[Text]
|
||||
@@ -32,7 +31,7 @@ def render_tex(tex, is_inline=True):
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stdout = katex.communicate(input=force_bytes(tex))[0]
|
||||
stdout = katex.communicate(input=tex.encode())[0]
|
||||
if katex.returncode == 0:
|
||||
# stdout contains a newline at the end
|
||||
assert stdout is not None
|
||||
|
||||
Reference in New Issue
Block a user