fixed 5cde217 causing assertion failures in debug mode
authorForrest Voight <forrest@forre.st>
Thu, 27 Jun 2013 17:02:25 +0000 (13:02 -0400)
committerForrest Voight <forrest@forre.st>
Thu, 27 Jun 2013 17:02:38 +0000 (13:02 -0400)
p2pool/util/pack.py

index 1ed2629..b2fd6da 100644 (file)
@@ -63,7 +63,9 @@ class Type(object):
         obj = self._unpack(data, ignore_trailing)
         
         if p2pool.DEBUG:
-            if self._pack(obj) != data:
+            packed = self._pack(obj)
+            good = data.startswith(packed) if ignore_trailing else data == packed
+            if not good:
                 raise AssertionError()
         
         return obj