Skip to content

Commit a223218

Browse files
author
g97iulio1609
committed
style: apply ruff format
1 parent 76362c3 commit a223218

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

src/mcp/server/mcpserver/utilities/logging.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def configure_logging(
4545
from rich.console import Console
4646
from rich.logging import RichHandler
4747

48-
handler: logging.Handler = RichHandler(
49-
console=Console(stderr=True), rich_tracebacks=True
50-
)
48+
handler: logging.Handler = RichHandler(console=Console(stderr=True), rich_tracebacks=True)
5149
except ImportError: # pragma: no cover
5250
handler = logging.StreamHandler()
5351
handler.setFormatter(logging.Formatter("%(message)s"))

src/mcp/server/stdio.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ async def stdio_server(stdin: anyio.AsyncFile[str] | None = None, stdout: anyio.
4242
# We duplicate the file descriptors via os.dup() to avoid closing the
4343
# real sys.stdin/sys.stdout when the wrapped streams are closed.
4444
if not stdin:
45-
stdin = anyio.wrap_file(
46-
TextIOWrapper(os.fdopen(os.dup(sys.stdin.fileno()), "rb"), encoding="utf-8")
47-
)
45+
stdin = anyio.wrap_file(TextIOWrapper(os.fdopen(os.dup(sys.stdin.fileno()), "rb"), encoding="utf-8"))
4846
if not stdout:
49-
stdout = anyio.wrap_file(
50-
TextIOWrapper(os.fdopen(os.dup(sys.stdout.fileno()), "wb"), encoding="utf-8")
51-
)
47+
stdout = anyio.wrap_file(TextIOWrapper(os.fdopen(os.dup(sys.stdout.fileno()), "wb"), encoding="utf-8"))
5248

5349
read_stream: MemoryObjectReceiveStream[SessionMessage | Exception]
5450
read_stream_writer: MemoryObjectSendStream[SessionMessage | Exception]

0 commit comments

Comments
 (0)