From 28a16188f69c7efa998d35448689708a9b15bc82 Mon Sep 17 00:00:00 2001 From: "M307 (Mac)" Date: Thu, 16 Feb 2023 12:51:51 +0700 Subject: [PATCH] add `await` before return (Issues: #34) --- enkanetwork/http.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/enkanetwork/http.py b/enkanetwork/http.py index d6dbca5..7c1721b 100644 --- a/enkanetwork/http.py +++ b/enkanetwork/http.py @@ -157,7 +157,7 @@ class HTTPClient: raise RuntimeError('Unreachable code in HTTP handling') - def fetch_user_by_uid( + async def fetch_user_by_uid( self, uid: Union[str, int], *, @@ -172,9 +172,9 @@ class HTTPClient: endpoint='enka', username=uid ) - return self.request(r) + return await self.request(r) - def fetch_user_by_username( + async def fetch_user_by_username( self, username: Union[str, int] ) -> Response[EnkaNetworkPayload]: @@ -184,9 +184,9 @@ class HTTPClient: endpoint='enka', username=username ) - return self.request(r) + return await self.request(r) - def fetch_hoyos_by_username( + async def fetch_hoyos_by_username( self, username: Union[str, int], metaname: str = "", @@ -200,16 +200,16 @@ class HTTPClient: endpoint='enka', username=username ) - return self.request(r) + return await self.request(r) - def fetch_asset(self, folder: str, filename: str) -> Response[DefaultPayload]: + async def fetch_asset(self, folder: str, filename: str) -> Response[DefaultPayload]: r = Route( 'GET', f'/mrwan200/enkanetwork.py-data/master/exports/{folder}/{filename}', endpoint='assets' ) - return self.request(r) + return await self.request(r) async def read_from_url(self, url: str) -> bytes: async with self.__session.get(url) as resp: