doc: internal: fix `MultiCapture.readouterr` (#6878)

Remove wrong docstring: it might actually return bytes.
Replace it with a type annotation which is clear enough.
This commit is contained in:
Daniel Hahler 2020-03-08 12:38:21 +01:00 committed by GitHub
parent db92cea14c
commit ac7ebfa22e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -510,12 +510,16 @@ class MultiCapture:
if self.in_:
self.in_.done()
def readouterr(self):
""" return snapshot unicode value of stdout/stderr capturings. """
return CaptureResult(
self.out.snap() if self.out is not None else "",
self.err.snap() if self.err is not None else "",
)
def readouterr(self) -> CaptureResult:
if self.out:
out = self.out.snap()
else:
out = ""
if self.err:
err = self.err.snap()
else:
err = ""
return CaptureResult(out, err)
class NoCapture: