python snippet du jour

Martin Pool mbp at canonical.com
Wed Dec 16 07:54:33 GMT 2009


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:

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list