errors.py should fail if one file is empty

This commit is contained in:
Roman Zeyde
2014-07-19 15:23:42 +03:00
parent 0da8e3d664
commit 4bc5351fac

View File

@@ -7,6 +7,9 @@ tx = bytearray(open(tx).read())
rx = bytearray(open(rx).read())
L = min(len(tx), len(rx))
if L == 0:
sys.exit(1)
rx = list(common.to_bits(rx[:L]))
tx = list(common.to_bits(tx[:L]))
indices = [index for index, (r, t) in enumerate(zip(rx, tx)) if r != t]