aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-04 23:27:57 -0500
committerRapptz <[email protected]>2017-03-04 23:27:57 -0500
commit76e76f2905d93d5ef16ff2c9015c7bd4918628b8 (patch)
tree756f4403672e0d28ddc402e95d923c976607f1d8 /discord/http.py
parentAdd commit number to pip version for easy identification. (diff)
downloaddiscord.py-76e76f2905d93d5ef16ff2c9015c7bd4918628b8.tar.xz
discord.py-76e76f2905d93d5ef16ff2c9015c7bd4918628b8.zip
Add underscore to HTTPClient.session to imply privateness.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/discord/http.py b/discord/http.py
index 699b2d4f..2627d966 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -90,7 +90,7 @@ class HTTPClient:
def __init__(self, connector=None, *, loop=None):
self.loop = asyncio.get_event_loop() if loop is None else loop
self.connector = connector
- self.session = aiohttp.ClientSession(connector=connector, loop=self.loop)
+ self._session = aiohttp.ClientSession(connector=connector, loop=self.loop)
self._locks = weakref.WeakValueDictionary()
self._global_lock = asyncio.Lock(loop=self.loop)
self.token = None
@@ -133,7 +133,7 @@ class HTTPClient:
yield from lock
with MaybeUnlock(lock) as maybe_lock:
for tries in range(5):
- r = yield from self.session.request(method, url, **kwargs)
+ r = yield from self._session.request(method, url, **kwargs)
log.debug(self.REQUEST_LOG.format(method=method, url=url, status=r.status, json=kwargs.get('data')))
try:
# even errors have text involved in them so this is safe to call
@@ -219,10 +219,7 @@ class HTTPClient:
@asyncio.coroutine
def close(self):
- yield from self.session.close()
-
- def recreate(self):
- self.session = aiohttp.ClientSession(connector=self.connector, loop=self.loop)
+ yield from self._session.close()
def _token(self, token, *, bot=True):
self.token = token