From 7d4d0c08a8d848cf2d5696a9bd4867352c7d6a43 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 25 Feb 2017 20:01:37 +0100 Subject: [PATCH] catching attributeerror --- rowers/c2stuff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index 676c724d..804df73c 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -354,7 +354,10 @@ def get_token(code): try: status_code = token_json['status_code'] except KeyError: - status_code = token_json.status_code + try: + status_code = token_json.status_code + except AttributeError: + return (0,'Attribute Error on c2_get_token') if status_code == 200: thetoken = token_json['access_token']