Skip to content

Commit 62993b3

Browse files
Fix tests on Windows.
1 parent 9fd1bb2 commit 62993b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_source_encoding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ def check_script_error(self, src, expected, lineno=...):
516516
err = res.err.rstrip()
517517
self.assertRegex(err.splitlines()[-1], b'SyntaxError: ' + expected)
518518
if lineno is not ...:
519-
self.assertIn(f', line {lineno}\n'.encode(), err)
519+
self.assertIn(f', line {lineno}\n'.encode(),
520+
err.replace(os.linesep.encode(), b'\n'))
520521
line = src.splitlines()[lineno-1].decode(errors='replace')
521522
if lineno == 1:
522523
line = line.removeprefix('\ufeff')

0 commit comments

Comments
 (0)