google / google/python-fire

AttributeError when calling a method which returns a BeautifulSoup object

Offen
#245 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
28.2k
Forks
1.5k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.