Fix doctest for current version of RustPython
@@ -102,7 +102,7 @@ import re
import sys
import traceback
import unittest
-from io import StringIO
+from io import StringIO # XXX: RUSTPYTHON; , IncrementalNewlineDecoder
from collections import namedtuple
TestResults = namedtuple('TestResults', 'failed attempted')
@@ -229,7 +229,10 @@ def _load_testfile(filename, package, module_relative, encoding):
file_contents = file_contents.decode(encoding)
# get_data() opens files as 'rb', so one must do the equivalent
# conversion as universal newlines would do.
- return _newline_convert(file_contents), filename
+
+ # TODO: RUSTPYTHON; use _newline_convert once io.IncrementalNewlineDecoder is implemented
+ return file_contents.replace(os.linesep, '\n'), filename
+ # return _newline_convert(file_contents), filename
with open(filename, encoding=encoding) as f:
return f.read(), filename
