[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/zrpc/smac.py using hashlib.sha1 if available in order to avoid DeprecationWarning

Andreas Jung andreas at andreas-jung.com
Mon Mar 30 16:16:54 EDT 2009


Log message for revision 98622:
  using hashlib.sha1 if available in order to avoid DeprecationWarning
  under Python 2.6
  

Changed:
  U   ZODB/trunk/src/ZEO/zrpc/smac.py

-=-
Modified: ZODB/trunk/src/ZEO/zrpc/smac.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/smac.py	2009-03-30 20:13:50 UTC (rev 98621)
+++ ZODB/trunk/src/ZEO/zrpc/smac.py	2009-03-30 20:16:54 UTC (rev 98622)
@@ -31,7 +31,10 @@
     import hmac
 except ImportError:
     import _hmac as hmac
-import sha
+try:
+    from hashlib import sha1 as sha
+except ImportError:
+    import sha
 import socket
 import struct
 import threading



More information about the Zodb-checkins mailing list