]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
exception when checksum does not match
authorAlex Morega <alex@grep.ro>
Sun, 7 Jul 2013 21:41:23 +0000 (23:41 +0200)
committerAlex Morega <alex@grep.ro>
Sun, 7 Jul 2013 21:59:29 +0000 (23:59 +0200)
scripts/download_import_cldr.py

index 68e64344b4d7be91af04314f5b4fb030fc79e9a6..3ee1af997f86db3a2705466680578640ef94b509 100755 (executable)
@@ -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():