From 42b42c1294144e18af999bb04a3e161cf9a2988b Mon Sep 17 00:00:00 2001 From: Christopher Mullins Date: Sun, 17 Sep 2017 18:46:40 -0400 Subject: [PATCH] BUG: github module count breaks in python3 In python2, filter returned a list, but in python3 it returns an iterator. So we wrap this in a list() so that it works in both. We also want to count the unread notifications, so this should be reflected in the code. --- bumblebee/modules/github.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index bbd3bd8..d9a5576 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -49,7 +49,7 @@ class Module(bumblebee.engine.Module): url = "https://api.github.com/notifications" while True: notifications = self._requests.get(url) - self._count += len(filter(lambda notification: notification.get("unread", False), notifications.json())) + self._count += len(list(filter(lambda notification: notification['unread'], notifications.json()))) next_link = notifications.links.get('next') if next_link is not None: url = next_link.get('url')