summaryrefslogtreecommitdiffstats
path: root/patches/opkg-utils-r4747/0007-opkg.py-use-hashlib-instead-of-old-md5-module.patch
blob: 1706cc3ee4fe78386b3e3f5191bccbad25767ecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 29 Mar 2012 12:44:01 +0200
Subject: [PATCH] opkg.py: use hashlib instead of old md5 module

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 opkg.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/opkg.py b/opkg.py
index 8ddc8b8..56e774d 100644
--- a/opkg.py
+++ b/opkg.py
@@ -36,7 +36,7 @@ import tempfile
 import os
 import sys
 import glob
-import md5
+import hashlib
 import re
 import string
 import commands
@@ -188,8 +188,8 @@ class Package:
     def _computeFileMD5(self):
         # compute the MD5.
         f = open(self.fn, "rb")
-        sum = md5.new()
-        while 1:
+        sum = hashlib.md5()
+        while True:
             data = f.read(1024)
             if not data: break
             sum.update(data)