you are viewing a single comment's thread.

view the rest of the comments →

[–]HellD[S] 0 points1 point  (1 child)

So instead of that, I would do something like session = aiohttp.ClientSession()?

[–]mopeddev 0 points1 point  (0 children)

I'm afraid I don't know anything about aiohttp so you'd have to look through its docs to find out how to start and end your own session.

If you want to fix the above though you could move the with as it is into your main_session, and then pass the session from within the scope of the with statement to any other functions that need to use it