@@ -278,15 +278,15 @@ def __init__(self, inner_stream, echo: bool = False,
278278 self .echo = echo
279279 self .encoding = encoding
280280 self .errors = errors
281- self .__store_output = True
281+ self .pause_storage = False
282282 self .buffer = ByteBuf (self )
283283
284284 def write (self , s : str ) -> None :
285285 """Add str to internal bytes buffer and if echo is True, echo contents to inner stream"""
286286 if not isinstance (s , str ):
287287 raise TypeError ('write() argument must be str, not {}' .format (type (s )))
288288
289- if self .__store_output :
289+ if not self .pause_storage :
290290 self .buffer .byte_buf += s .encode (encoding = self .encoding , errors = self .errors )
291291 if self .echo :
292292 self .inner_stream .write (s )
@@ -315,17 +315,6 @@ def clear(self) -> None:
315315 """Clear the internal contents"""
316316 self .buffer .byte_buf = b''
317317
318- def get_store_output (self ) -> bool :
319- return self .__store_output
320-
321- def set_store_output (self , store_output : bool ) -> None :
322- """
323- Set whether output should be saved in buffer.byte_buf
324- :param store_output: Store output if True, otherwise do not and clear the buffer
325- """
326- self .__store_output = self .buffer .store_output = store_output
327- self .clear ()
328-
329318 def __getattr__ (self , item : str ):
330319 if item in self .__dict__ :
331320 return self .__dict__ [item ]
@@ -345,7 +334,7 @@ def write(self, b: bytes) -> None:
345334 """Add bytes to internal bytes buffer and if echo is True, echo contents to inner stream."""
346335 if not isinstance (b , bytes ):
347336 raise TypeError ('a bytes-like object is required, not {}' .format (type (b )))
348- if self .std_sim_instance .get_store_output () :
337+ if not self .std_sim_instance .pause_storage :
349338 self .byte_buf += b
350339 if self .std_sim_instance .echo :
351340 self .std_sim_instance .inner_stream .buffer .write (b )
0 commit comments