changeset 1278:4b686925f035

Fix sha1 import for Python 2.4.
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 14:29:22 +0200
parents 26f7a133172a
children 513ad56cd8cc
files viff/hash_broadcast.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/hash_broadcast.py	Fri Oct 09 16:33:15 2009 +0200
+++ b/viff/hash_broadcast.py	Fri Oct 16 14:29:22 2009 +0200
@@ -19,7 +19,10 @@
 
 from twisted.internet.defer import gatherResults, Deferred, DeferredList
 
-from hashlib import sha1
+try:
+    from hashlib import sha1
+except ImportError:
+    from sha import sha as sha1
 from viff.constants import TEXT, INCONSISTENTHASH, OK, HASH, SIGNAL
 
 error_msg = "Player %i, has received an inconsistent hash %s."