From 9e90c33081aa7edbb39135530ed4c38457254573 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Tue, 13 Dec 2016 10:28:18 -0800 Subject: [PATCH] Fix TypeError if error description is None --- google/oauth2/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google/oauth2/_client.py b/google/oauth2/_client.py index 1b26549b7..468cb7e88 100644 --- a/google/oauth2/_client.py +++ b/google/oauth2/_client.py @@ -48,9 +48,9 @@ def _handle_error_response(response_body): """ try: error_data = json.loads(response_body) - error_details = ': '.join([ + error_details = '{}: {}'.format( error_data['error'], - error_data.get('error_description')]) + error_data.get('error_description')) # If no details could be extracted, use the response data. except (KeyError, ValueError): error_details = response_body