mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix doctest for current version of RustPython
This commit is contained in:
1 parent
e12b3a60d4
commit
b5e4d62da4
1 file changed
+5
-2
Vendored
+5
-2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user