mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
#15980: properly escape newlines in docstrings. Patch by Serhiy Storchaka.
This commit is contained in:
parent
3d2fc15f82
commit
003014bf1e
4 changed files with 6 additions and 6 deletions
|
@ -63,7 +63,7 @@ def _bdecode(s):
|
|||
"""Decodes a base64 string.
|
||||
|
||||
This function is equivalent to base64.decodestring and it's retained only
|
||||
for backward compatibility. It used to remove the last \n of the decoded
|
||||
for backward compatibility. It used to remove the last \\n of the decoded
|
||||
string, if it had any (see issue 7143).
|
||||
"""
|
||||
if not s:
|
||||
|
@ -73,7 +73,7 @@ def _bdecode(s):
|
|||
|
||||
|
||||
def fix_eols(s):
|
||||
"""Replace all line-ending characters with \r\n."""
|
||||
"""Replace all line-ending characters with \\r\\n."""
|
||||
# Fix newlines with no preceding carriage return
|
||||
s = re.sub(r'(?<!\r)\n', CRLF, s)
|
||||
# Fix carriage returns with no following newline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue