1
0
Fork 0
mirror of synced 2024-05-05 05:02:30 +12:00

Asyncio changed, need async with now

This commit is contained in:
phxntxm 2018-07-14 23:05:43 -05:00
parent 09d8f0535a
commit d88a34f1a5

View file

@ -71,7 +71,7 @@ async def request(url, *, headers=None, payload=None, method='GET', attr='json',
for i in range(5):
try:
# Create the session with our headeres
with aiohttp.ClientSession(headers=headers) as session:
async with aiohttp.ClientSession(headers=headers) as session:
# Make the request, based on the method, url, and paramaters given
async with session.request(method, url, params=payload) as response:
# If the request wasn't successful, re-attempt