Applied patch from Tomi Tuominen to fix deprecation warning.
authorLars Wirzenius <liw@liw.fi>
Thu, 15 Apr 2010 08:08:35 +0000 (20:08 +1200)
committerLars Wirzenius <liw@liw.fi>
Thu, 15 Apr 2010 08:08:35 +0000 (20:08 +1200)
Python's md5 module is deprecated. The hashlib module replaces it.

eoc.py

diff --git a/eoc.py b/eoc.py
index b385fcfc2cb256a71e0ea8a3a40ccac36b67a8c9..ac899233bf4bb3e92906688383665c37725608bf 100644 (file)
--- a/eoc.py
+++ b/eoc.py
@@ -8,7 +8,7 @@ VERSION = "1.2.6"
 PLUGIN_INTERFACE_VERSION = "1"
 
 import getopt
-import md5
+import hashlib
 import os
 import shutil
 import smtplib
@@ -78,8 +78,7 @@ COMMANDS = SIMPLE_COMMANDS + SUB_COMMANDS + HASH_COMMANDS
 
 
 def md5sum_as_hex(s):
-    return md5.new(s).hexdigest()
-
+    return hashlib.md5(s).hexdigest()
 
 def forkexec(argv, text):
     """Run a command (given as argv array) and write text to its stdin"""