Skip to content

Commit a1aa6b8

Browse files
authored
更新 phystokens.py
fix #1838 (comment)
1 parent 22cd381 commit a1aa6b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coverage/phystokens.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def _phys_tokens(toks: TokenInfos) -> TokenInfos:
5757
if last_ttext.endswith("\\"):
5858
inject_backslash = False
5959
elif ttype == token.STRING:
60-
if last_line.endswith(last_ttext + "\\\n"):
60+
if last_line.endswith("\\\n") and last_line.rstrip(" \\\n").endswith(last_text):
6161
# Deal with special cases like such code::
6262
#
63-
# a = ["aaa",\
63+
# a = ["aaa",\ # there may be zero or more blanks between "," and "\".
6464
# "bbb \
6565
# ccc"]
6666
#

0 commit comments

Comments
 (0)