~ubuntuone-control-tower/ubuntu-sso-client/stable-1-4

« back to all changes in this revision

Viewing changes to ubuntu_sso/account.py

  • Committer: Tarmac
  • Author(s): Alejandro J. Cura
  • Date: 2012-06-27 12:21:28 UTC
  • mfrom: (773.1.2 use-pycurl-1-4)
  • Revision ID: tarmac-20120627122128-s5ejw70xrpnp62nn
- Use pycurl instead of httplib (LP: #882055).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
import re
23
 
import urllib2
24
23
 
25
24
# Unable to import 'lazr.restfulclient.*'
26
25
# pylint: disable=F0401
32
31
from oauth import oauth
33
32
 
34
33
from ubuntu_sso.logger import setup_logging
35
 
from ubuntu_sso.utils import timestamp_checker
 
34
from ubuntu_sso.utils import curllib, timestamp_checker
36
35
 
37
36
 
38
37
logger = setup_logging("ubuntu_sso.account")
140
139
        # download captcha and save to 'filename'
141
140
        logger.debug('generate_captcha: server answered: %r', captcha)
142
141
        try:
143
 
            res = urllib2.urlopen(captcha['image_url'])
 
142
            res = curllib.urlopen(captcha['image_url'])
144
143
            with open(filename, 'wb') as f:
145
144
                f.write(res.read())
146
145
        except: