File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 2525
2626
2727class Client :
28- __loop : asyncio .AbstractEventLoop
2928 __http_client : AbstractHTTPClient
3029 __has_token : bool
3130
32- def __init__ (self , solvedac_token : Optional [str ] = None , http_library : HTTPClientLibrary = None ) -> None :
31+ def __init__ (self , solvedac_token : Optional [str ] = None , http_client : AbstractHTTPClient = None ) -> None :
3332 try :
3433 asyncio .set_event_loop_policy (asyncio .WindowsSelectorEventLoopPolicy ())
3534 except AttributeError :
3635 pass
37- self .__loop = asyncio .get_event_loop ()
38- self .__http_client = get_http_client (self .__loop , solvedac_token = solvedac_token , lib = http_library )
36+
37+ if http_client is None :
38+ self .__http_client = get_http_client (solvedac_token = solvedac_token )
39+ else :
40+ self .__http_client = http_client
3941 self .__has_token = bool (solvedac_token )
4042
4143 async def get_user (self , handle : str ) -> Models .User :
@@ -272,7 +274,9 @@ async def verify_account_credentials(self) -> Models.AccountInfo:
272274 :return: :class:`Models.AccountInfo`
273275 """
274276
275- response : ResponseData = await self .__http_client .request (Route (RequestMethod .GET , "/account/verify_credentials" ))
277+ response : ResponseData = await self .__http_client .request (
278+ Route (RequestMethod .GET , "/account/verify_credentials" )
279+ )
276280
277281 check_stats_code (response .status )
278282
You can’t perform that action at this time.
0 commit comments