~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 07:05:00 UTC
  • mfrom: (3376.2.15 no-asserts)
  • Revision ID: pqm@pqm.ubuntu.com-20080508070500-9zyyvsk0eev20t4w
(mbp) remove and disallow assert statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
        # confused
310
310
        Request.__init__(self, 'CONNECT', request.get_full_url(),
311
311
                         connection=request.connection)
312
 
        assert request.proxied_host is not None
 
312
        if request.proxied_host is None:
 
313
            raise AssertionError()
313
314
        self.proxied_host = request.proxied_host
314
315
 
315
316
    def get_selector(self):
502
503
        The request will be retried once if it fails.
503
504
        """
504
505
        connection = request.connection
505
 
        assert connection is not None, \
506
 
            'Cannot process a request without a connection'
 
506
        if connection is None:
 
507
            raise AssertionError(
 
508
                'Cannot process a request without a connection')
507
509
 
508
510
        # Get all the headers
509
511
        headers = {}
595
597
 
596
598
    def https_open(self, request):
597
599
        connection = request.connection
598
 
        assert isinstance(connection, HTTPSConnection)
599
600
        if connection.sock is None and \
600
601
                connection.proxied_host is not None and \
601
602
                request.get_method() != 'CONNECT' : # Don't loop