diff options
| author | 2010-08-22 11:02:22 +0200 | |
|---|---|---|
| committer | 2010-08-22 21:18:44 +0200 | |
| commit | e4640c86461ba77eb653349a7bd085bde60a527e (patch) | |
| tree | 92fd9afdcbb85ee4c9c4dfd1f4e6cff4fe95dda5 | |
| parent | c1879e6f8d8e3f4fa2e8d4a94868a0fad8fd4720 (diff) | |
replace deprecated md5 and sha module with hashlib
| -rw-r--r-- | minidinstall/misc.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/minidinstall/misc.py b/minidinstall/misc.py index 2a3467c..b8f323a 100644 --- a/minidinstall/misc.py +++ b/minidinstall/misc.py @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import os, errno, time, string, re, popen2 +import os, errno, time, string, re, popen2, hashlib def dup2(fd,fd2): # dup2 with EBUSY retries (cf. dup2(2) and Debian bug #265513) @@ -56,11 +56,9 @@ def get_file_sum(self, type, filename): def _get_internal_file_sum(self ,type, filename): """ generate hash sums for file with python modules """ if type == 'md5': - import md5 - sum = md5.new() + sum = hashlib.md5() elif type == 'sha1': - import sha - sum = sha.new() + sum = hashlib.sha1() elif type == 'sha256': from Crypto.Hash import SHA256 sum = SHA256.new() |
