wagnerrp / pytmdb3

Python interface to TheMovieDB.org v3 API
BSD 3-Clause "New" or "Revised" License
122 stars 36 forks source link

fix: #26 check existence of datapoint.poller.func #78

Open kadaliao opened 4 years ago

kadaliao commented 4 years ago

ElementType always creates a dummy poller for those Datapoints without function. (https://github.com/wagnerrp/pytmdb3/blob/07c849512d8043d74ecf90c85eb2c6445e09171e/tmdb3/util.py#L354)

So self.poller is not None in Data.__get__ will never be True. (https://github.com/wagnerrp/pytmdb3/blob/07c849512d8043d74ecf90c85eb2c6445e09171e/tmdb3/util.py#L150)

It causes problem like #26

Check self.poller.func is not None instead will fix it.

kadaliao commented 4 years ago

And should return the default value for Datapoint if there is no data and no poller function.