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

Printing Promise objects from asynchronous Runner.run() raises Attribute Error #996

Open
dqian3 opened this issue Jun 3, 2024 · 0 comments

Comments

@dqian3
Copy link

dqian3 commented Jun 3, 2024

@task
def test(c):
    promise = c.run("sleep 5", asynchronous=True)
    print(promise)
    promise.join()

As a new user of invoke, I noticed that when I would try to print the promise returned by a Runner.run call with asynchronous=True (see above code for an example), I would get the following error:

AttributeError: 'Promise' object has no attribute 'exited'

Looking at runners.py, it seems the issue is that since Promise is a subclass of Result, and so inherits its __str__ method.

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

1 participant