Skip to content

Commit 1a0010d

Browse files
committed
fix: assert existence of stderr
Needed to make the mypy be quiet about the ‹fileno()› on possibly ‹None›. Signed-off-by: Matej Focko <[email protected]>
1 parent d7076c4 commit 1a0010d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

specfile/context_management.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def capture_stderr() -> Generator[List[bytes], None, None]:
2323
Yields:
2424
List of captured lines.
2525
"""
26+
assert sys.__stderr__, "stderr should exist"
2627
fileno = sys.__stderr__.fileno()
2728
with tempfile.TemporaryFile() as stderr, os.fdopen(os.dup(fileno)) as backup:
2829
sys.stderr.flush()

0 commit comments

Comments
 (0)