Permalink
Browse files

Make use of Django's hashcompat module.

  • Loading branch information...
1 parent 5d3b5c5 commit 029a159fe3f920d59e0168af72177b343daa4256 @jezdez jezdez committed Jun 20, 2010
Showing with 2 additions and 5 deletions.
  1. +2 −5 phased/__init__.py
View
@@ -1,10 +1,7 @@
from django.conf import settings
+from django.utils.hashcompat import sha_constructor
def generate_secret_delimiter():
- try:
- from hashlib import sha1
- except ImportError:
- from sha import sha as sha1
- return sha1(getattr(settings, 'SECRET_KEY', '')).hexdigest()
+ return sha_constructor(getattr(settings, 'SECRET_KEY', '')).hexdigest()
LITERAL_DELIMITER = getattr(settings, 'LITERAL_DELIMITER', generate_secret_delimiter())

0 comments on commit 029a159

Please sign in to comment.