]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht/Hash.py
Added unittests to bencode module for boolean and unicode types.
[quix0rs-apt-p2p.git] / apt_dht / Hash.py
index 3149f5872f886049fb5f7aa8b9d5947a23d074b1..bb993f1755bbbb80d5b8a23a2afb40a17b2c53fb 100644 (file)
@@ -53,7 +53,7 @@ class HashObject:
         if bits is not None:
             bytes = (bits - 1) // 8 + 1
         else:
-            assert(bytes is not None)
+            assert bytes is not None, "you must specify one of bits or bytes"
         if len(hashString) < bytes:
             hashString = hashString + '\000'*(bytes - len(hashString))
         elif len(hashString) > bytes: