[RFC/MERGE][bug #269535] python-2.6 compatibility

Andrew Bennetts andrew at canonical.com
Fri Sep 26 04:30:13 BST 2008


Martin Pool wrote:
[...]
> >
> > - __init__ and __new__ doesn't accept parameters anymore. Some
> >  were easy to fix, some less. Remote transports using multiple
> >  inheritance for SmartMedium has been slightly reworked to
> >  *avoid* the multiple inheritance.
> 
> I can't believe __init__ cannot take parameters any more.  Do you mean
> that object.__init__ won't accept any parameters it's given?

Yes.  That change was the resolution of
<http://bugs.python.org/issue1683368>.  It surprised me too, but it was
intentional.

[...]
> > === modified file 'bzrlib/tests/test_http.py'
[...]
> > -    def test_get_smart_medium(self):
> > -        # For HTTP, get_smart_medium should return the transport object.
> > -        server = self.get_readonly_server()
> > -        http_transport = self._transport(server.get_url())
> > -        medium = http_transport.get_smart_medium()
> > -        self.assertIs(medium, http_transport)
> > -
> >      def test_has_on_bogus_host(self):
> >          # Get a free address and don't 'accept' on it, so that we
> >          # can be sure there is no http handler there, but set a
> 
> OK, so now you have a separate medium from the transport object this
> test would not pass its final assertion.  But why not still run it and
> check we get _a_ medium?  (Or maybe that's covered enough elsewhere?)

It is covered elsewhere; see test_get_smart_medium in
test_transport_implementations.

-Andrew.




More information about the bazaar mailing list