Skip to content

Commit

Permalink
DEV: Remove ._buf on RandomTextIO
Browse files Browse the repository at this point in the history
No longer needed now that callback method for persisting the
underlying stream contents is implemented.

Closes #67.
  • Loading branch information
bskinn committed Sep 5, 2019
1 parent ec9f50f commit e393d66
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/stdio_mgr/stdio_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class RandomTextIO(TextIOWrapper):
def __init__(self):
"""Initialise buffer with utf-8 encoding."""
self._stream = _PersistedBytesIO(self._set_closed_buf)
self._buf = BufferedRandom(self._stream)
super().__init__(self._buf, encoding="utf-8")
super().__init__(BufferedRandom(self._stream), encoding="utf-8")

def write(self, *args, **kwargs):
"""Flush after each write."""
Expand Down
2 changes: 0 additions & 2 deletions tests/test_stdiomgr_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,6 @@ def test_stdout_detached(convert_newlines):
f = o.detach()

assert isinstance(f, io.BufferedRandom)
assert f is o._buf
assert f is i.tee._buf

assert convert_newlines("test str\n") == o.getvalue()

Expand Down

0 comments on commit e393d66

Please sign in to comment.