mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
This commit is contained in:
commit
48e6a8c88a
8 changed files with 15 additions and 24 deletions
|
@ -160,15 +160,7 @@ class BaseTest(unittest.TestCase):
|
|||
the expected_values list of tuples."""
|
||||
stream = stream or self.stream
|
||||
pat = re.compile(pat or self.expected_log_pat)
|
||||
try:
|
||||
if hasattr(stream, 'reset'):
|
||||
stream.reset()
|
||||
elif hasattr(stream, 'seek'):
|
||||
stream.seek(0)
|
||||
actual_lines = stream.readlines()
|
||||
except AttributeError:
|
||||
# StringIO.StringIO lacks a reset() method.
|
||||
actual_lines = stream.getvalue().splitlines()
|
||||
actual_lines = stream.getvalue().splitlines()
|
||||
self.assertEqual(len(actual_lines), len(expected_values))
|
||||
for actual, expected in zip(actual_lines, expected_values):
|
||||
match = pat.search(actual)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue