/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/launchpad/lp_registration.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import urllib
24
24
import xmlrpclib
25
25
 
26
 
from breezy import (
 
26
from ... import (
27
27
    config,
28
28
    errors,
29
29
    urlutils,
30
30
    __version__ as _breezy_version,
31
31
    )
32
 
from breezy.transport.http import _urllib2_wrappers
 
32
from ...transport.http import _urllib2_wrappers
33
33
 
34
34
 
35
35
# for testing, do
193
193
        method = getattr(proxy, method_name)
194
194
        try:
195
195
            result = method(*method_params)
196
 
        except xmlrpclib.ProtocolError, e:
 
196
        except xmlrpclib.ProtocolError as e:
197
197
            if e.errcode == 301:
198
198
                # TODO: This can give a ProtocolError representing a 301 error, whose
199
199
                # e.headers['location'] tells where to go and e.errcode==301; should
206
206
                # TODO: print more headers to help in tracking down failures
207
207
                raise errors.BzrError("xmlrpc protocol error connecting to %s: %s %s"
208
208
                        % (self.service_url, e.errcode, e.errmsg))
209
 
        except socket.gaierror, e:
 
209
        except socket.gaierror as e:
210
210
            raise errors.ConnectionError(
211
211
                "Could not resolve '%s'" % self.domain,
212
212
                orig_error=e)
228
228
            resolve = _request_factory(path)
229
229
            try:
230
230
                result = resolve.submit(self)
231
 
            except xmlrpclib.Fault, fault:
 
231
            except xmlrpclib.Fault as fault:
232
232
                raise errors.InvalidURL(branch_url, str(fault))
233
233
            branch_url = result['urls'][0]
234
234
            path = urlsplit(branch_url)[2]