Rev 3915: Get rid of asserts in inventory.py. in file:///home/vila/src/bzr/experimental/bbc-cleanups/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Mar 31 17:08:55 BST 2009


At file:///home/vila/src/bzr/experimental/bbc-cleanups/

------------------------------------------------------------
revno: 3915
revision-id: v.ladeuil+lp at free.fr-20090331160855-kxqqt9rot95c9iro
parent: v.ladeuil+lp at free.fr-20090331160431-m9335vx3suhjrqvp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: bbc-cleanups
timestamp: Tue 2009-03-31 18:08:55 +0200
message:
  Get rid of asserts in inventory.py.
-------------- next part --------------
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2009-03-30 11:49:32 +0000
+++ b/bzrlib/inventory.py	2009-03-31 16:08:55 +0000
@@ -1653,7 +1653,8 @@
         :return: A CHKInventory
         """
         lines = bytes.split('\n')
-        assert lines[-1] == ''
+        if lines[-1] != '':
+            raise AssertionError('bytes to deserialize must end with an eol')
         lines.pop()
         if lines[0] != 'chkinventory:':
             raise ValueError("not a serialised CHKInventory: %r" % bytes)



More information about the bazaar-commits mailing list