mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 18:26:15 +01: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:
parent
9ef41fde95
commit
35be8342e3
11
osc/core.py
11
osc/core.py
@ -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):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user