From: Alberto GarcĂ­a Hierro Date: Mon, 13 Sep 2010 18:09:40 +0000 (+0200) Subject: Avoid raising a KeyError when there's no session expiration date X-Git-Tag: v1.2.0~135^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98e4344fe66663d690003b39af3ac5808e499623;p=thirdparty%2Ftornado.git Avoid raising a KeyError when there's no session expiration date It happens when the token is requested with the 'offline_access' extended permission. --- diff --git a/tornado/auth.py b/tornado/auth.py index d77e5c479..dd9b6202b 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -963,7 +963,7 @@ class FacebookGraphMixin(OAuth2Mixin): callback, response): session = { "access_token": cgi.parse_qs(response.body)["access_token"][-1], - "expires": cgi.parse_qs(response.body)["expires"] + "expires": cgi.parse_qs(response.body).get("expires") } self.facebook_request(