add assertion to ECC

This commit is contained in:
Roman Zeyde
2014-07-04 19:00:54 +03:00
parent a5571d13d0
commit 286fe9010e

1
ecc.py
View File

@@ -34,6 +34,7 @@ def decode(data, nsym=DEFAULT_NSYM):
except ReedSolomonError:
break
assert i, 'No blocks decoded!'
overhead = (i - len(dec)) / float(i)
blocks = i / BLOCK_SIZE
log.debug('Decoded %d blocks = %d bytes (ECC overhead %.1f%%)', blocks, len(dec), overhead * 100)