Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 57a83db

Browse filesBrowse files
committed
try IncrementalNewlineDecoder in doctest
1 parent 3ad8fd7 commit 57a83db
Copy full SHA for 57a83db

File tree

1 file changed

+2
-4
lines changed
Filter options

1 file changed

+2
-4
lines changed

‎Lib/doctest.py

Copy file name to clipboardExpand all lines: Lib/doctest.py
+2-4Lines changed: 2 additions & 4 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 # XXX: RUSTPYTHON; , IncrementalNewlineDecoder
105+
from io import StringIO, IncrementalNewlineDecoder
106106
from collections import namedtuple
107107

108108
TestResults = namedtuple('TestResults', 'failed attempted')
@@ -230,9 +230,7 @@ def _load_testfile(filename, package, module_relative, encoding):
230230
# get_data() opens files as 'rb', so one must do the equivalent
231231
# conversion as universal newlines would do.
232232

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
233+
return _newline_convert(file_contents), filename
236234
with open(filename, encoding=encoding) as f:
237235
return f.read(), filename
238236

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.