We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c50270 commit 9aaa404Copy full SHA for 9aaa404
coverage/phystokens.py
@@ -57,7 +57,15 @@ def _phys_tokens(toks: TokenInfos) -> TokenInfos:
57
if last_ttext.endswith("\\"):
58
inject_backslash = False
59
elif ttype == token.STRING:
60
- if "\n" in ttext and ttext.split("\n", 1)[0][-1] == "\\":
+ if last_line.endswith(last_ttext+"\\\n"):
61
+ # Deal with special cases like such code::
62
+ #
63
+ # a = ["aaa",\
64
+ # "bbb \
65
+ # ccc"]
66
67
+ pass
68
+ elif "\n" in ttext and ttext.split("\n", 1)[0][-1] == "\\":
69
# It's a multi-line string and the first line ends with
70
# a backslash, so we don't need to inject another.
71
0 commit comments