From 78c78c61d1ab1ffb0964cba2f157c126693a076a Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 1 Oct 2019 21:59:00 -0400 Subject: [PATCH] Change fetch logic to be more logical --- src/utils/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/utils.py b/src/utils/utils.py index ca569a3..c7f9fe2 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -87,10 +87,10 @@ asession = aiohttp.ClientSession() async def fetch(url, *, params={}, json=False, response=False, text=False): async with asession.get(url, params=params, headers={ 'User-Agent': 'Myned/Modufur (https://github.com/Myned/Modufur)'}, ssl=False) as r: - if json: - return await r.json() - elif response: + if response: return r + elif json: + return await r.json() elif text: return await r.text() else: