@@ -128,7 +128,7 @@ def __init__(self, verb: HTTPVerb, path: str, **params: Any) -> None:
128128
129129class HTTPClient :
130130 __slots__ = (
131- "__session " ,
131+ "_session " ,
132132 "_async" ,
133133 "_token" ,
134134 "_locks" ,
@@ -137,18 +137,18 @@ class HTTPClient:
137137
138138 def __init__ (self , * , token : Optional [str ], session : Optional [aiohttp .ClientSession ] = None ) -> None :
139139 self ._token : Optional [str ] = token
140- self .__session : Optional [aiohttp .ClientSession ] = session
140+ self ._session : Optional [aiohttp .ClientSession ] = session
141141 self ._locks : weakref .WeakValueDictionary = weakref .WeakValueDictionary ()
142142 user_agent = "mystbin.py (https://github.com/PythonistaGuild/mystbin.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}"
143143 self .user_agent : str = user_agent .format (__version__ , sys .version_info , aiohttp .__version__ )
144144
145145 async def _generate_session (self ) -> aiohttp .ClientSession :
146- self .__session = aiohttp .ClientSession ()
147- return self .__session
146+ self ._session = aiohttp .ClientSession ()
147+ return self ._session
148148
149149 async def request (self , route : Route , ** kwargs : Any ) -> Any :
150- if self .__session is None :
151- self .__session = await self ._generate_session ()
150+ if self ._session is None :
151+ self ._session = await self ._generate_session ()
152152
153153 bucket = route .path
154154 lock = self ._locks .get (bucket )
@@ -177,7 +177,7 @@ async def request(self, route: Route, **kwargs: Any) -> Any:
177177 with MaybeUnlock (lock ) as maybe_lock :
178178 for tries in range (5 ):
179179 try :
180- async with self .__session .request (route .verb , route .url , ** kwargs ) as response :
180+ async with self ._session .request (route .verb , route .url , ** kwargs ) as response :
181181 # Requests remaining before ratelimit
182182 remaining = response .headers .get ("x-ratelimit-remaining" , None )
183183 LOGGER .debug ("remaining is: %s" , remaining )
0 commit comments