[neatx commit] r17 - Work around md5 module deprecation in py2.6

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 16, 2009, 5:30:38 AM7/16/09
to ne...@googlegroups.com
Author: kormat
Date: Thu Jul 16 02:29:06 2009
New Revision: 17

Modified:
trunk/neatx/lib/session.py

Log:
Work around md5 module deprecation in py2.6

Reviewed-By: imsnah


Modified: trunk/neatx/lib/session.py
==============================================================================
--- trunk/neatx/lib/session.py (original)
+++ trunk/neatx/lib/session.py Thu Jul 16 02:29:06 2009
@@ -24,11 +24,16 @@

import errno
import logging
-import md5
import os
import os.path
import random
import time
+
+# md5 module is deprecated in python2.6, hashlib is the replacement
+try:
+ import hashlib as md5
+except ImportError:
+ import md5

from neatx import constants
from neatx import serializer

Reply all
Reply to author
Forward
0 new messages