summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-01 06:00:22 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-01 06:00:22 -0500
commitb7b796fff9962cbe7940ee026024af562a9f334c (patch)
tree20ced365a64dcedc65d262a57e3fae3d662669b3
parentc5c2027624de16d11e697d6d342e23b0aa5bb23f (diff)
downloadledger-b7b796fff9962cbe7940ee026024af562a9f334c.tar.gz
ledger-b7b796fff9962cbe7940ee026024af562a9f334c.tar.bz2
ledger-b7b796fff9962cbe7940ee026024af562a9f334c.zip
In acprep, use md5 module if hashlib isn't present
-rwxr-xr-xacprep11
1 files changed, 9 insertions, 2 deletions
diff --git a/acprep b/acprep
index 753f5986..ac009078 100755
--- a/acprep
+++ b/acprep
@@ -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()