google / google/python-fire

AttributeError when calling a method which returns a BeautifulSoup object

Đang mở
#245 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
28.2k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is a small example to reproduce the error:

```
import bs4
import fire

assert fire.__version__ == "0.3.1"

class Test:
def get_soup(self):
soup = bs4.BeautifulSoup("

hi

")
return soup

fire.Fire(Test)
```

If I run this file via

```
python test.py get_soup
```

I get the error "AttributeError: 'NoneType' object has no attribute 'get'".

If I run

```
python test.py get_soup -- --interactive
```

the variable result does not contain the expected soup object, but instead ">"

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.