diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:39:14 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:39:14 -0700 |
commit | 1454c32dc0c5c99b3efb27be2306e0e06e433121 (patch) | |
tree | 8b7ffaf0dff019d871ceb81cbdcb46d9cbe3c328 /scripts/install.py | |
parent | b012a60951f612b9a2c912dd64c00a3b09af5d3f (diff) | |
parent | 7306690dbd005cd595b72c01350452d7a5439d20 (diff) |
Merge with trunk
Diffstat (limited to 'scripts/install.py')
-rwxr-xr-x | scripts/install.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/install.py b/scripts/install.py index 6278fba16c..78b8880b95 100755 --- a/scripts/install.py +++ b/scripts/install.py @@ -64,7 +64,6 @@ def add_indra_lib_path(): base_dir = add_indra_lib_path() import copy -import md5 import optparse import os import platform @@ -75,7 +74,12 @@ import tempfile import urllib2 import urlparse -from sets import Set as set, ImmutableSet as frozenset +try: + # Python 2.6 + from hashlib import md5 +except ImportError: + # Python 2.5 and earlier + from md5 import new as md5 from indra.base import llsd from indra.util import helpformatter @@ -106,7 +110,7 @@ class InstallFile(object): return "ifile{%s:%s}" % (self.pkgname, self.url) def _is_md5sum_match(self): - hasher = md5.new(file(self.filename, 'rb').read()) + hasher = md5(file(self.filename, 'rb').read()) if hasher.hexdigest() == self.md5sum: return True return False |