From c4f9670738dc8e08e948685bbd9860d09f7d9a3d Mon Sep 17 00:00:00 2001 From: fengfeng Date: Wed, 30 Oct 2024 13:53:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index c426cf2..395ff35 100644 --- a/main.py +++ b/main.py @@ -66,10 +66,10 @@ class Console(cmd2.Cmd): future = asyncio.run_coroutine_threadsafe(_input(prompt), self.ioLoop) return await asyncio.wrap_future(future) - async def AsyncPrint(self, output): - async def _print(output): - print(output) - future = asyncio.run_coroutine_threadsafe(_print(output), self.ioLoop) + async def AsyncPrint(self, *args, **kwargs): + async def _print(*args, **kwargs): + print(*args, **kwargs) + future = asyncio.run_coroutine_threadsafe(_print(*args, **kwargs), self.ioLoop) await asyncio.wrap_future(future) def __init__(self): @@ -90,7 +90,7 @@ class Console(cmd2.Cmd): # 3. 设置console self.saved_readline_settings = None with self.sigint_protection: - saved_readline_settings = self._set_up_cmd2_readline() + self.saved_readline_settings = self._set_up_cmd2_readline() def postloop(self): # 1. 还原console设置