Skip to content

Commit 843861c

Browse files
author
FuNK3Y
committed
python-ecosys/aiohttp: Nicer syntax.
Signed-off-by: FuNK3Y <fun__key@hotmail.com>
1 parent 589e6cb commit 843861c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

python-ecosys/aiohttp/aiohttp/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ def _decode(self, data):
4242
return data
4343

4444
async def read(self, sz=-1):
45-
if sz == -1:
46-
return self._decode(await self.content.read(sz))
47-
else:
48-
return self._decode(await self.content.readexactly(sz))
45+
return self._decode(await (self.content.read(sz) if sz == -1 else self.content.readexactly(sz)))
4946

5047
async def text(self, encoding="utf-8"):
5148
return (await self.read(int(self._get_header("content-length", -1)))).decode(encoding)

0 commit comments

Comments
 (0)