Skip to content

Commit bf56e7d

Browse files
committed
Fix Windows
1 parent 6347ed7 commit bf56e7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/tokenize.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ def add_backslash_continuation(self, start):
193193
if row_offset == 0:
194194
return
195195

196+
newline = '\r\n' if self.prev_line.endswith('\r\n') else '\n'
196197
line = self.prev_line.rstrip('\\\r\n')
197198
ws = ''.join(_itertools.takewhile(str.isspace, reversed(line)))
198-
self.tokens.append(ws + "\\\n" * row_offset)
199+
self.tokens.append(ws + f"\\{newline}" * row_offset)
199200
self.prev_col = 0
200201

201202
def escape_brackets(self, token):

0 commit comments

Comments
 (0)