Skip to content

Commit

Permalink
Fix Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Oct 26, 2024
1 parent 6347ed7 commit bf56e7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ def add_backslash_continuation(self, start):
if row_offset == 0:
return

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

def escape_brackets(self, token):
Expand Down

0 comments on commit bf56e7d

Please sign in to comment.