This commit is contained in:
Kovid Goyal 2021-07-04 07:15:15 +05:30
parent 10d359c222
commit 86a8b231f4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -96,8 +96,8 @@ def to_cmdline(x: str) -> List[str]:
def python_string(text: str) -> str: def python_string(text: str) -> str:
import ast from ast import literal_eval
ans: str = ast.literal_eval("'''" + text.replace("'''", "'\\''") + "'''") ans: str = literal_eval("'''" + text.replace("'''", "'\\''") + "'''")
return ans return ans