From bfff31c729ac23f59aae213e481ce31997cec91f Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Sun, 7 Jul 2013 23:41:23 +0200 Subject: [PATCH] exception when checksum does not match --- scripts/download_import_cldr.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py index 68e64344..3ee1af99 100755 --- a/scripts/download_import_cldr.py +++ b/scripts/download_import_cldr.py @@ -60,7 +60,12 @@ def is_good_file(filename): if not blk: break h.update(blk) - return h.hexdigest() == FILESUM + digest = h.hexdigest() + if digest != FILESUM: + raise RuntimeError('Checksum mismatch: %r != %r' + % (digest, FILESUM)) + else: + return True def main(): -- 2.47.2