From ae406a736d4cf53f162412d8ddaee48df72e4bef Mon Sep 17 00:00:00 2001 From: phxntxm Date: Tue, 17 Jan 2017 10:23:07 -0600 Subject: [PATCH] Corrected an indentation error --- cogs/overwatch.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cogs/overwatch.py b/cogs/overwatch.py index 6619838..3680f8b 100644 --- a/cogs/overwatch.py +++ b/cogs/overwatch.py @@ -26,26 +26,26 @@ class Overwatch: self.headers = {"User-Agent": config.user_agent} self.session = aiohttp.ClientSession() -async def _request(self, payload, endpoint): - """Handles requesting to the API""" + async def _request(self, payload, endpoint): + """Handles requesting to the API""" - # Format the URL we'll need based on the base_url, and the endpoint we want to hit - url = "{}{}".format(base_url, endpoint) + # Format the URL we'll need based on the base_url, and the endpoint we want to hit + url = "{}{}".format(base_url, endpoint) - # Attempt to connect up to our max retries - for x in range(MAX_RETRIES): - try: - async with aiohttp.ClientSession(headers=self.headers) as session: - async with session.get(url, params=payload) as r: - # If we failed to connect, attempt again - if r.status != 200: - continue + # Attempt to connect up to our max retries + for x in range(MAX_RETRIES): + try: + async with aiohttp.ClientSession(headers=self.headers) as session: + async with session.get(url, params=payload) as r: + # If we failed to connect, attempt again + if r.status != 200: + continue - data = await r.json() - return data - # If any error happened when making the request, attempt again - except: - continue + data = await r.json() + return data + # If any error happened when making the request, attempt again + except: + continue @commands.group(no_pm=True) async def ow(self):