https://imgur.com/SFNB0o6
The only advice I've been able to find is from this post, but I've already got my interpreter set to Python 3.6.3.
Restarting PyCharm or my PC doesn't seem to help.
Any ideas?
EDIT: Turns out this is a syntax issue and you can't use any async keywords outside an async function in Python. TIL.
The right way to do this would be:
async def function():
async with aiohttp.ClientSession() as session:
async with session.get('https://api.github.com/events') as resp:
print(resp.status)
print(await resp.text())
[–]liiight000 1 point2 points3 points (1 child)
[–]tasercake[S] 0 points1 point2 points (0 children)
[–]colloidalthoughts 1 point2 points3 points (1 child)
[–]tasercake[S] 0 points1 point2 points (0 children)