Printing Promise objects from asynchronous Runner.run() raises Attribute Error
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start in invoke/runners.py, where Promise inherits Result and receives its str behavior. Reproduce the example with Runner.run(..., asynchronous=True), then verify that printing the returned Promise no longer raises AttributeError about exited while promise.join() still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@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.
- Ngôn ngữ chính
- Python
- Star
- 4.8k
- Fork
- 412
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyinvoke/invoke
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
sdist is missing `pytest.ini` Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Tất cả issue của pyinvoke/invoke
Issue tương tự
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100