/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 bzrlib/transport/__init__.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:
134
134
                             register_netloc=False):
135
135
    transport_list_registry.register_transport(prefix, help)
136
136
    if register_netloc:
137
 
        assert prefix.endswith('://')
 
137
        if not prefix.endswith('://'):
 
138
            raise ValueError(prefix)
138
139
        register_urlparse_netloc_protocol(prefix[:-3])
139
140
 
140
141
 
370
371
        object or string to another one.
371
372
        This just gives them something easy to call.
372
373
        """
373
 
        assert not isinstance(from_file, basestring), \
374
 
            '_pump should only be called on files not %s' % (type(from_file,))
375
374
        return osutils.pumpfile(from_file, to_file)
376
375
 
377
376
    def _get_total(self, multi):
966
965
 
967
966
        :returns: the length of relpath before the content was written to it.
968
967
        """
969
 
        assert isinstance(bytes, str), \
970
 
            'bytes must be a plain string, not %s' % type(bytes)
 
968
        if not isinstance(bytes, str):
 
969
            raise TypeError(
 
970
                'bytes must be a plain string, not %s' % type(bytes))
971
971
        return self.append_file(relpath, StringIO(bytes), mode=mode)
972
972
 
973
973
    def append_multi(self, files, pb=None):
1561
1561
            transport, last_err = _try_transport_factories(base, factory_list)
1562
1562
            if transport:
1563
1563
                if possible_transports is not None:
1564
 
                    assert transport not in possible_transports
 
1564
                    if transport in possible_transports:
 
1565
                        raise AssertionError()
1565
1566
                    possible_transports.append(transport)
1566
1567
                return transport
1567
1568