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_: if self.in_:
self.in_.done() self.in_.done()
def readouterr(self): def readouterr(self) -> CaptureResult:
""" return snapshot unicode value of stdout/stderr capturings. """ if self.out:
return CaptureResult( out = self.out.snap()
self.out.snap() if self.out is not None else "", else:
self.err.snap() if self.err is not None else "", out = ""
) if self.err:
err = self.err.snap()
else:
err = ""
return CaptureResult(out, err)
class NoCapture: class NoCapture: