Skip to content

Commit eae36a3

Browse files
author
Nova
committed
fix: add coverage pragmas for _NoCloseTextIOWrapper methods
Both close() and __del__ are no-op overrides that prevent TextIOWrapper from closing real stdio handles. They are not directly tested in this PR (the test is on #2821) and __del__ relies on GC timing which is unreliable in tests.
1 parent 73c70ca commit eae36a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/mcp/server/stdio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class _NoCloseTextIOWrapper(TextIOWrapper):
3838
print() or input() calls in the parent process.
3939
"""
4040

41-
def close(self) -> None:
41+
def close(self) -> None: # pragma: lax no cover
4242
# Intentionally not closing the underlying buffer.
4343
# The standard process handles should outlive the server.
4444
pass
4545

46-
def __del__(self) -> None:
46+
def __del__(self) -> None: # pragma: lax no cover
4747
# Prevent TextIOWrapper.__del__ from calling close().
4848
pass
4949

0 commit comments

Comments
 (0)