piplcom / piplapis-python

Python client library for Pipl's APIs
Other
33 stars 29 forks source link

Problem in SearchAPIResponse.to_dict() #6

Closed srabi closed 7 years ago

srabi commented 8 years ago

Hi, Using python 3.4 with the latest piplapis version.

For a certain search I get a crash in: File "/home/sivanr/env/lib/python3.4/site-packages/piplapis/data/available_data.py", line 17, in to_dict d['premium'] = self.premium.to_dict() File "/home/sivanr/env/lib/python3.4/site-packages/piplapis/data/available_data.py", line 84, in to_dict if getattr(self, child) > 0: TypeError: unorderable types: NoneType() > int() I looked into this function for debug and found that in certain responses (not always) the result of getattr(self, child) returns None, hence the error message. Please check if the problem is that a result of getattr is None or that this function should support this and check in advance.

joshliberty commented 7 years ago

Was fixed by https://github.com/piplcom/piplapis-python/pull/4 Released in 5.1.1