Changeset 3553

Show
Ignore:
Timestamp:
04/25/08 18:40:35 (9 months ago)
Author:
pacopablo
Message:

Fallback to sha module when haslib not available

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tgauthplugin/0.11/tgauth/main.py

    r3552 r3553  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 import hashlib 
     32try: 
     33    from hashlib import sha1 
     34except ImportError: 
     35     from sha import new as sha1 
    3336 
    3437from trac.core import Component, implements 
     
    8992        if not hashed: 
    9093            return False 
    91         return hashlib.sha1(password).hexdigest() == hashed 
     94        return sha1(password).hexdigest() == hashed 
    9295 
    9396    def delete_user(self, user):