[Python-checkins] r88924 - tracker/instances/python-dev/lib/openid2rp.py
martin.v.loewis
python-checkins at python.org
Fri Nov 25 01:38:58 CET 2011
Author: martin.v.loewis
Date: Fri Nov 25 01:38:58 2011
New Revision: 88924
Log:
Try to cope with base addinfourl objects.
Modified:
tracker/instances/python-dev/lib/openid2rp.py
Modified: tracker/instances/python-dev/lib/openid2rp.py
==============================================================================
--- tracker/instances/python-dev/lib/openid2rp.py (original)
+++ tracker/instances/python-dev/lib/openid2rp.py Fri Nov 25 01:38:58 2011
@@ -436,7 +436,7 @@
data['openid.session_type'] = ''
del data['openid.ns']
res = FancyURLopener().open(url, b(urllib.urlencode(data)))
- if res.getcode() != 200:
+ if hasttr(res, 'getcode') and res.getcode() != 200:
raise ValueError, "OpenID provider refuses connection with status %d" % res.getcode()
data = parse_response(res.read())
if 'error' in data:
@@ -568,7 +568,7 @@
# "openid.mode"
request.extend((k, v) for k, (v,) in response.items() if 'openid.mode' != k)
res = FancyURLopener().open(op_endpoint, urllib.urlencode(request))
- if 200 != res.getcode():
+ if hasttr(res, 'getcode') and 200 != res.getcode():
raise NotAuthenticated(NotAuthenticated.CONNECTION_REFUSED, res.getcode())
response = parse_response(res.read())
if 'true' != response['is_valid']:
More information about the Python-checkins
mailing list