From 94dd8cd7bb90ec27e58f7fd6fcf3aacba52aeceb Mon Sep 17 00:00:00 2001 From: inactivist Date: Mon, 12 Nov 2012 23:48:39 -0800 Subject: [PATCH] Fixing broken unit test from prior commit. Need to deal with null (None) 'place' attribute in Status objects. --- tweepy/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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): -- 2.25.1