~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

Fixed as per review comments.

* bzrlib/transport/http/_urllib2_wrappers.py:
(Request.set_proxy): No need to test sef.port, it's never set anyway.

* bzrlib/plugins/launchpad/lp_registration.py:
(XMLRPCTransport): Renamed from Transport to avoid too much
confusion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
 
367
367
    def set_proxy(self, proxy, type):
368
368
        """Set the proxy and remember the proxied host."""
369
 
        if self.port is None:
370
 
            # We need to set the default port ourselves way before it gets set
371
 
            # by the HTTPConnection build time.
372
 
            if self.type == 'https':
373
 
                conn_class = HTTPSConnection
374
 
            else:
375
 
                conn_class = HTTPConnection
376
 
            port = conn_class.default_port
 
369
        # We need to set the default port ourselves way before it gets set
 
370
        # in the HTTP[S]Connection object at build time.
 
371
        if self.type == 'https':
 
372
            conn_class = HTTPSConnection
377
373
        else:
378
 
            port = self.port
379
 
        self.proxied_host = '%s:%s' % (self.get_host(), port)
 
374
            conn_class = HTTPConnection
 
375
        self.proxied_host = '%s:%s' % (self.get_host(), conn_class.default_port)
380
376
        urllib2.Request.set_proxy(self, proxy, type)
381
377
 
382
378