Skip to content

Commit b5e4d62

Browse files
committed
Fix doctest for current version of RustPython
1 parent e12b3a6 commit b5e4d62

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/doctest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _test():
102102
import sys
103103
import traceback
104104
import unittest
105-
from io import StringIO
105+
from io import StringIO # XXX: RUSTPYTHON; , IncrementalNewlineDecoder
106106
from collections import namedtuple
107107

108108
TestResults = namedtuple('TestResults', 'failed attempted')
@@ -229,7 +229,10 @@ def _load_testfile(filename, package, module_relative, encoding):
229229
file_contents = file_contents.decode(encoding)
230230
# get_data() opens files as 'rb', so one must do the equivalent
231231
# conversion as universal newlines would do.
232-
return _newline_convert(file_contents), filename
232+
233+
# TODO: RUSTPYTHON; use _newline_convert once io.IncrementalNewlineDecoder is implemented
234+
return file_contents.replace(os.linesep, '\n'), filename
235+
# return _newline_convert(file_contents), filename
233236
with open(filename, encoding=encoding) as f:
234237
return f.read(), filename
235238

0 commit comments

Comments
 (0)