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

CLI commands are incorrectly async #128

Closed
tari opened this Issue Aug 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@tari
Copy link
Contributor

tari commented Aug 15, 2018

Some CLI commands are incorrectly declared as async def, which causes them to do nothing, and Python prints a warning on exit that nothing waited on the coroutine.

The ones I've tested firsthand exhibiting this behavior are form and permit. Changing async def to just def fixes the problem- util.app handles the event loop itself, so the CLI commands taking this form should not be declared async.

@AndreasBomholtz

This comment has been minimized.

Copy link
Collaborator

AndreasBomholtz commented Aug 15, 2018

Thanks you for reporting this.
Can you make a pull request with the fixes?

tari added a commit to tari/bellows that referenced this issue Aug 19, 2018

Un-async CLI functions that explicitly invoke app()
app() does the CLI wrangling itself, so calling these functions async is
incorrect and makes the commands do nothing, since they resolve to
futures that are never waited on.

Fixes zigpy#128.

tari added a commit to tari/bellows that referenced this issue Aug 19, 2018

Un-async CLI functions that explicitly invoke app()
app() does the loop wrangling itself, so calling these functions async is
incorrect and makes the commands do nothing, since they resolve to
futures that are never waited on.

Fixes zigpy#128.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment