Complete.Org: Mailing Lists: Archives: offlineimap: December 2008:
[PATCH] Import md5 from hashlib if available.
Home

[PATCH] Import md5 from hashlib if available.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Cc: Loui Chang <louipc.ist@xxxxxxxxx>
Subject: [PATCH] Import md5 from hashlib if available.
From: Loui Chang <louipc.ist@xxxxxxxxx>
Date: Thu, 4 Dec 2008 16:45:15 -0500

The md5 module is deprecated and hashlib is available
since python 2.5.

Signed-off-by: Loui Chang <louipc.ist@xxxxxxxxx>
---
 offlineimap/folder/Maildir.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py
index d1921b8..d1d5077 100644
--- a/offlineimap/folder/Maildir.py
+++ b/offlineimap/folder/Maildir.py
@@ -16,11 +16,16 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
+import os.path, os, re, time, socket
 from Base import BaseFolder
 from offlineimap import imaputil
 from offlineimap.ui import UIBase
 from threading import Lock
-import os.path, os, re, time, socket, md5
+
+try:
+    from hashlib import md5
+except ImportError:
+    import md5
 
 uidmatchre = re.compile(',U=(\d+)')
 flagmatchre = re.compile(':.*2,([A-Z]+)')
-- 
1.6.0.4




[Prev in Thread] Current Thread [Next in Thread]