[Pkg-bazaar-commits] ./bzr/unstable r237: - Better assertions in InventoryEntry constructor

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:30 UTC 2009


------------------------------------------------------------
revno: 237
committer: mbp at sourcefrog.net
timestamp: Mon 2005-04-11 12:45:04 +1000
message:
  - Better assertions in InventoryEntry constructor
modified:
  bzrlib/inventory.py
-------------- next part --------------
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2005-04-06 14:06:32 +0000
+++ b/bzrlib/inventory.py	2005-04-11 02:45:04 +0000
@@ -127,7 +127,6 @@
         
         self.file_id = file_id
         self.name = name
-        assert kind in ['file', 'directory']
         self.kind = kind
         self.text_id = text_id
         self.parent_id = parent_id
@@ -135,8 +134,11 @@
         self.text_size = None
         if kind == 'directory':
             self.children = {}
+        elif kind == 'file':
+            pass
         else:
-            assert kind == 'file'
+            raise BzrError("unhandled entry kind %r" % kind)
+
 
 
     def sorted_children(self):



More information about the Pkg-bazaar-commits mailing list