Skip to content

Commit 595ea22

Browse files
committed
refactor: these tests are always true, remove them
1 parent 911678a commit 595ea22

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

coverage/phystokens.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ 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("\\\n") and
60+
if (last_line.endswith("\\\n") and # pylint: disable=simplifiable-if-statement
6161
last_line.rstrip(" \\\n").endswith(last_ttext)):
6262
# Deal with special cases like such code::
6363
#
@@ -66,13 +66,12 @@ def _phys_tokens(toks: TokenInfos) -> TokenInfos:
6666
# ccc"]
6767
#
6868
inject_backslash = True
69-
elif "\n" in ttext and ttext.split("\n", 1)[0][-1] == "\\":
69+
else:
7070
# It's a multi-line string and the first line ends with
7171
# a backslash, so we don't need to inject another.
7272
inject_backslash = False
7373
elif sys.version_info >= (3, 12) and ttype == token.FSTRING_MIDDLE:
74-
if ttext.split("\n", 1)[0][-1] == "\\":
75-
inject_backslash = False
74+
inject_backslash = False
7675
if inject_backslash:
7776
# Figure out what column the backslash is in.
7877
ccol = len(last_line.split("\n")[-2]) - 1

0 commit comments

Comments
 (0)