From: inactivist Date: Tue, 13 Nov 2012 07:48:39 +0000 (-0800) Subject: Fixing broken unit test from prior commit. Need to deal with null (None) 'place... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=94dd8cd7bb90ec27e58f7fd6fcf3aacba52aeceb;p=tweepy.git Fixing broken unit test from prior commit. Need to deal with null (None) 'place' attribute in Status objects. --- diff --git a/tweepy/models.py b/tweepy/models.py index f5838dd..cae46ee 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -63,7 +63,10 @@ class Status(Model): elif k == 'retweeted_status': setattr(status, k, Status.parse(api, v)) elif k == 'place': - setattr(status, k, Place.parse(api, v)) + if v is not None: + setattr(status, k, Place.parse(api, v)) + else: + setattr(status, k, None) else: setattr(status, k, v) return status @@ -328,8 +331,9 @@ class BoundingBox(Model): @classmethod def parse(cls, api, json): result = cls(api) - for k, v in json.items(): - setattr(result, k, v) + if json is not None: + for k, v in json.items(): + setattr(result, k, v) return result def origin(self):