Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: This event loop is already running #35

Closed
araa47 opened this issue Jun 2, 2018 · 2 comments
Closed

RuntimeError: This event loop is already running #35

araa47 opened this issue Jun 2, 2018 · 2 comments

Comments

@araa47
Copy link

araa47 commented Jun 2, 2018

Hey, I'm trying to run some code to send some emails, however, I am already using the event loop for another task. When I try running the line loop.run_until_complete(smtp.connect())
I get the following error " RuntimeError: This event loop is already running ".

@skillian
Copy link

skillian commented Jun 2, 2018

Hey, I answered this question on StackOverflow before!

https://stackoverflow.com/questions/39754020/runtime-error-event-loop-is-running

@cole
Copy link
Owner

cole commented Jun 3, 2018

As @skillian pointed out, if the loop is already running, don't use loop.run_until_complete. If you're in an async function, just use await; otherwise, I would use loop.create_task.

@cole cole closed this as completed Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants