Skip to content

RuntimeError: Run loop already active. #1754

Answered by dlech
EclecticInventor asked this question in Q&A
Discussion options

You must be logged in to vote

Oop, didn't notice the run_task() in attractLights. That is the actual source of the problem. It needs to be replaced with await.

    async def attractLights():
        hub.light.on(Color.RED)
        await subtask()

Although subtask() currently isn't awaiting anything itself, so it could actually be turned onto a regular fucntion.

Replies: 1 comment 17 replies

Comment options

You must be logged in to vote
17 replies
@dlech
Comment options

@EclecticInventor
Comment options

@dlech
Comment options

@dlech
Comment options

Answer selected by EclecticInventor
@EclecticInventor
Comment options

@dlech
Comment options

@EclecticInventor
Comment options

@EclecticInventor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants