From 05d51efacebbefa323a4c49889cc42f9dfd417a4 Mon Sep 17 00:00:00 2001 From: Daniil Fajnberg Date: Sun, 13 Feb 2022 20:58:36 +0100 Subject: [PATCH] simplified method --- src/asyncio_taskpool/session.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/asyncio_taskpool/session.py b/src/asyncio_taskpool/session.py index 70298e8..b35a0f8 100644 --- a/src/asyncio_taskpool/session.py +++ b/src/asyncio_taskpool/session.py @@ -142,16 +142,12 @@ class ControlSession: async def _parse_command(self, msg: str) -> None: try: - args, argv = self._parser.parse_known_args(msg.split(' ')) + args = self._parser.parse_args(msg.split(' ')) except ArgumentError as e: self._writer.write(str(e).encode()) return except HelpRequested: return - if argv: - log.debug("%s sent unknown arguments: %s", self._client_class_name, msg) - self._writer.write(b"Invalid command!") - return await self._execute_command(args) async def listen(self) -> None: