File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def _phys_tokens(toks: TokenInfos) -> TokenInfos:
57
57
if last_ttext .endswith ("\\ " ):
58
58
inject_backslash = False
59
59
elif ttype == token .STRING :
60
- if (last_line .endswith ("\\ \n " ) and
60
+ if (last_line .endswith ("\\ \n " ) and # pylint: disable=simplifiable-if-statement
61
61
last_line .rstrip (" \\ \n " ).endswith (last_ttext )):
62
62
# Deal with special cases like such code::
63
63
#
@@ -66,13 +66,12 @@ def _phys_tokens(toks: TokenInfos) -> TokenInfos:
66
66
# ccc"]
67
67
#
68
68
inject_backslash = True
69
- elif " \n " in ttext and ttext . split ( " \n " , 1 )[ 0 ][ - 1 ] == " \\ " :
69
+ else :
70
70
# It's a multi-line string and the first line ends with
71
71
# a backslash, so we don't need to inject another.
72
72
inject_backslash = False
73
73
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
76
75
if inject_backslash :
77
76
# Figure out what column the backslash is in.
78
77
ccol = len (last_line .split ("\n " )[- 2 ]) - 1
You can’t perform that action at this time.
0 commit comments