1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

core: fix the dgst_from_string function for Python 2.4 compatibility. It can't

have worked and must have returned empty md5 hashes, and I assume that the
function isn't actually used anywhere.
This commit is contained in:
Dr. Peter Poeml 2009-06-05 11:29:11 +00:00
parent 9ef41fde95
commit 35be8342e3

View File

@ -2291,15 +2291,16 @@ def get_binary_file(apiurl, prj, repo, arch,
except: pass
def dgst_from_string(str):
# Python 2.5 depracates the md5 modules
# Python 2.4 doesn't have hashlib yet
try:
import hashlib
md5 = hashlib
md5_hash = hashlib.md5()
except ImportError:
import md5
md5 = md5
s = md5.md5()
s.update(str)
return s.hexdigest()
md5_hash = md5.new()
md5_hash.update(str)
return md5_hash.hexdigest()
def dgst(file):