MCPcopy Index your code
hub / github.com/fastapi/typer / StreamMixer

Class StreamMixer

typer/testing.py:45–60  ·  view source on GitHub ↗

Mixes ` ` and ` ` streams. The result is available in the ``output`` attribute.

Source from the content-addressed store, hash-verified

43
44
45class StreamMixer:
46 """Mixes `<stdout>` and `<stderr>` streams.
47
48 The result is available in the ``output`` attribute.
49 """
50
51 def __init__(self) -> None:
52 self.output: io.BytesIO = io.BytesIO()
53 self.stdout: io.BytesIO = BytesIOCopy(copy_to=self.output)
54 self.stderr: io.BytesIO = BytesIOCopy(copy_to=self.output)
55
56 def __del__(self) -> None:
57 """Guarantee that file-like objects are closed in a predictable order"""
58 self.stderr.close()
59 self.stdout.close()
60 self.output.close()
61
62
63class _NamedTextIOWrapper(io.TextIOWrapper):

Callers 1

isolationMethod · 0.85

Calls

no outgoing calls

Tested by 1

isolationMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…