summaryrefslogtreecommitdiff
path: root/indra/lib/python/uuid.py
diff options
context:
space:
mode:
authorDessie Linden <dessie@lindenlab.com>2010-10-19 13:47:15 -0700
committerDessie Linden <dessie@lindenlab.com>2010-10-19 13:47:15 -0700
commit42e397e155239932a75fa694dc77d9dd952e3c09 (patch)
tree1d3cb00d99a585879facf6dce5b7133dbd8ad6da /indra/lib/python/uuid.py
parenta63b83775120f7ebe3bafb897da70e4e41bda6a4 (diff)
parentc683151587067cb2758206432610d4ff4884036e (diff)
Merged from 2.3.0-beta1 tag in viewer-development
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():