From 59a7185b2ecd5cd14fb4bbefe4d23f2bf2a37747 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sat, 6 Aug 2022 12:10:33 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- aioaria2/client.py | 4 +--- aioaria2/utils.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/aioaria2/client.py b/aioaria2/client.py index e513c45..7834eb9 100644 --- a/aioaria2/client.py +++ b/aioaria2/client.py @@ -84,9 +84,7 @@ async def jsonrpc(self, method: str, params: Optional[List[Any]] = None, prefix: if self.mode == 'batch': await self.queue.put(req_obj) return None - if self.mode == 'format': - return req_obj - return await self.send_request(req_obj) + return req_obj if self.mode == 'format' else await self.send_request(req_obj) async def send_request(self, req_obj: Dict[str, Any]) -> Union[Dict[str, Any], Any]: raise NotImplementedError diff --git a/aioaria2/utils.py b/aioaria2/utils.py index a81a818..5093eb5 100644 --- a/aioaria2/utils.py +++ b/aioaria2/utils.py @@ -147,7 +147,7 @@ def read_configfile(path: str, prefix: str = "--") -> Generator[str, None, None] :return: """ with open(path, "r") as f: - for line in f.readlines(): + for line in f: line = line.strip() if line and not line.startswith("#"): yield prefix + line