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:
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
You can’t perform that action at this time.
0 commit comments