From db5168a67566803bbd8f6162ece6935c6fbafeae Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Thu, 19 Sep 2019 22:48:03 +0100 Subject: [PATCH] support format switch --- github/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/github/__init__.py b/github/__init__.py index 67079c4..bbeec66 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -77,6 +77,12 @@ def get_events(): for f in iter_events(): with Path(f).open() as fo: jj = json.load(fo) + + # quick hack to adapt for both old & new formats + if 'events' in jj: + jj = jj['events'] + # + for e in jj: eid = e['id'] prev = events.get(eid, None)