summaryrefslogtreecommitdiff
path: root/indra/lib/python/uuid.py
diff options
context:
space:
mode:
authorChristian Goetze (CG) <cg@lindenlab.com>2010-09-23 12:56:31 -0700
committerChristian Goetze (CG) <cg@lindenlab.com>2010-09-23 12:56:31 -0700
commit92195c479f597538a55dfa8b2e02c1b4908a2259 (patch)
tree2af86834aa11e66f7e74057f4172d29dfd0703e7 /indra/lib/python/uuid.py
parent78e52f40424cb8336ab5d06c9ea37e16cb2b40a7 (diff)
parent18bd7dfae789ce0d6be3de3811d6d779fc4ec63e (diff)
Merged support for platform specific permanent quick links to the installer
Diffstat (limited to 'indra/lib/python/uuid.py')
-rw-r--r--indra/lib/python/uuid.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/lib/python/uuid.py b/indra/lib/python/uuid.py
index 48dac84377..0bc21a35f8 100644
--- a/indra/lib/python/uuid.py
+++ b/indra/lib/python/uuid.py
@@ -446,8 +446,14 @@ 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:
+ # Python 2.6
+ from hashlib import md5
+ except ImportError:
+ # Python 2.5 and earlier
+ from md5 import new as md5
+
+ hash = md5(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=3)
def uuid4():