(note: I have not tested this since facebook seems not to be using a dictionary anymore)
You could do a simple try catch, something like: try: if data.get("comments", 0): m["comments"] = [] for item in data["comments"]["comment_list"]: m["comments"].append({ "text": item["text"], "time": int(mx.DateTime.DateTimeFrom(item["time"]).gmtime()), "sender": self._sender(profiles[item["fromid"]]), }) catch TypeError if data.get("comments", 0): m["comments"] = [] for item in data["comments"]["comment_list"].values(): m["comments"].append({ "text": item["text"], "time": int(mx.DateTime.DateTimeFrom(item["time"]).gmtime()), "sender": self._sender(profiles[item["fromid"]]), }) -- facebook is always a day or two OLD https://bugs.launchpad.net/bugs/572011 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs