Skip to content

Commit c5ed3ab

Browse files
committed
typing fix
1 parent 04eacf9 commit c5ed3ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/_pytest/capture.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,10 @@ def writeorg(self, data):
689689
class TeeSysCapture(SysCapture):
690690
def __init__(self, fd: int) -> None:
691691
old = getattr(sys, patchsysdict[fd])
692-
if fd != 0:
693-
tmpfile = PassthroughCaptureIO(old)
692+
if fd == 0:
693+
super().__init__(fd)
694694
else:
695-
tmpfile = None
696-
super().__init__(fd, tmpfile)
695+
super().__init__(fd, PassthroughCaptureIO(old))
697696
assert self._old == old, (self._old, old)
698697

699698

0 commit comments

Comments
 (0)