google / google/python-fire

AttributeError when calling a method which returns a BeautifulSoup object

未关闭
#245 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
28.2k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

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 ">"

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。