Skip to content

Commit abb3b31

Browse files
[3.14] gh-63161: Fix test_source_encoding when stderr is StringIO (GH-140361)
1 parent 6493a6a commit abb3b31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_source_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def check_script_error(self, src, expected, lineno=...):
521521
line = src.splitlines()[lineno-1].decode(errors='replace')
522522
if lineno == 1:
523523
line = line.removeprefix('\ufeff')
524-
line = line.encode(sys.stderr.encoding, sys.stderr.errors)
524+
line = line.encode(sys.__stderr__.encoding, sys.__stderr__.errors)
525525
self.assertIn(line, err)
526526

527527

0 commit comments

Comments
 (0)