[patch 3/6] make checkers.py compatible with Python 2.4

1 view
Skip to first unread message

Felix Schwarz

unread,
Mar 12, 2008, 4:43:30 PM3/12/08
to authori...@googlegroups.com

"import hashlib" is Python 2.5, use a fallback for Python 2.4

--
Mit freundlichen Grüßen
Felix Schwarz
Dipl.-Informatiker

Gubener Str. 38
10243 Berlin
Germany

www.schwarz.eu - Software-Entwicklung und Beratung

compatibility_24

Kevin Horn

unread,
Mar 12, 2008, 7:29:33 PM3/12/08
to authori...@googlegroups.com
diff -r ca482e4a9110 authority/checkers/checkers.py
--- a/authority/checkers/checkers.py    Wed Mar 12 16:45:25 2008 +0100
+++ b/authority/checkers/checkers.py    Wed Mar 12 16:45:42 2008 +0100
@@ -3,7 +3,10 @@ log = logging.getLogger(__name__)
 log = logging.getLogger(__name__)

 # TODO: only works for Py 2.5 -> do something else for 2.4
-from hashlib import md5
+try:
+    from hashlib import md5
+except ImportError:
+    from md5 import md5

 class AuthenticationChecker(object):
    '''



applied

Kevin Horn
Reply all
Reply to author
Forward
0 new messages