stouputils.ctx.muffle module#

class Muffle(mute_stderr: bool = False)[source]#

Bases: AbstractBothContextManager[Muffle]

Context manager that temporarily silences output. (No thread-safety guaranteed)

Alternative to @silent

Examples

>>> with Muffle():
...     print("This will not be printed")
mute_stderr: bool#

Attribute remembering if stderr should be muted

original_stdout: IO[Any]#

Attribute remembering original stdout

original_stderr: IO[Any]#

Attribute remembering original stderr

_abc_impl = <_abc._abc_data object>#