viff

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 diff
     1.1 --- a/viff/hash_broadcast.py	Fri Oct 09 16:33:15 2009 +0200
     1.2 +++ b/viff/hash_broadcast.py	Fri Oct 16 14:29:22 2009 +0200
     1.3 @@ -19,7 +19,10 @@
     1.4  
     1.5  from twisted.internet.defer import gatherResults, Deferred, DeferredList
     1.6  
     1.7 -from hashlib import sha1
     1.8 +try:
     1.9 +    from hashlib import sha1
    1.10 +except ImportError:
    1.11 +    from sha import sha as sha1
    1.12  from viff.constants import TEXT, INCONSISTENTHASH, OK, HASH, SIGNAL
    1.13  
    1.14  error_msg = "Player %i, has received an inconsistent hash %s."