diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-01 06:00:22 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-01 06:00:22 -0500 |
commit | b7b796fff9962cbe7940ee026024af562a9f334c (patch) | |
tree | 20ced365a64dcedc65d262a57e3fae3d662669b3 | |
parent | c5c2027624de16d11e697d6d342e23b0aa5bb23f (diff) | |
download | ledger-b7b796fff9962cbe7940ee026024af562a9f334c.tar.gz ledger-b7b796fff9962cbe7940ee026024af562a9f334c.tar.bz2 ledger-b7b796fff9962cbe7940ee026024af562a9f334c.zip |
In acprep, use md5 module if hashlib isn't present
-rwxr-xr-x | acprep | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -18,9 +18,13 @@ import shutil import string import sys import time -import hashlib import tempfile +try: + import hashlib +except: + import md5 + from os.path import * from stat import * from subprocess import Popen, PIPE, call @@ -623,7 +627,10 @@ class PrepareBuild(CommandLineApp): sys.exit(1) fd = open(tarball) - csum = hashlib.md5() + try: + csum = hashlib.md5() + except: + csum = md5.md5() csum.update(fd.read()) fd.close() digest = csum.hexdigest() |