mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 08:00:02 -06:00
Fix Python 2.6 deprecation warning with the md5 import. Use hashlib instead.
This commit is contained in:
parent
944371a38c
commit
30f9f77727
@ -529,8 +529,11 @@ def uuid1(node=None, clock_seq=None):
|
||||
|
||||
def uuid3(namespace, name):
|
||||
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
|
||||
import md5
|
||||
hash = md5.md5(namespace.bytes + name).digest()
|
||||
try:
|
||||
from hashlib import md5
|
||||
except ImportError:
|
||||
from md5 import md5
|
||||
hash = md5(namespace.bytes + name).digest()
|
||||
return UUID(bytes=hash[:16], version=3)
|
||||
|
||||
def uuid4():
|
||||
|
Loading…
Reference in New Issue
Block a user