python snippet du jour

Gary van der Merwe garyvdm at gmail.com
Thu Dec 17 08:36:53 GMT 2009


On 16/12/2009 09:54, Martin Pool wrote:
> I hope this amuses you as much as it did me:
>
>           """Return the .bzrdir style format present in a directory."""
>           try:
>               format_string = transport.get_bytes(".bzr/branch-format")
> -        except errors.NoSuchFile:
> +        except errors.NoSuchFile, errors.TransportNotPossible:
>               raise errors.NotBranchError(path=transport.base)
>
>           try:
>


Ha ha.  I'm guilty of making the same mistake.



More information about the bazaar mailing list