diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-08-06 21:48:09 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-08-11 15:59:58 -0500 |
commit | 869537f3b703119ceb397b85ca38b4dff99b8d6b (patch) | |
tree | 7a04be825fba23bf7d74c10b6c65f1e33a44cf50 /src/lib/Client | |
parent | def7fbd92d988851b94636175b5bab998407c4e6 (diff) | |
download | bcfg2-869537f3b703119ceb397b85ca38b4dff99b8d6b.tar.gz bcfg2-869537f3b703119ceb397b85ca38b4dff99b8d6b.tar.bz2 bcfg2-869537f3b703119ceb397b85ca38b4dff99b8d6b.zip |
Don't assume python2.5 is being used on successful hashlib import
The hashlib module has been backported to earlier versions of python. If
we assume that 2.5 is in use, then python will go crazy looking for
stuff that doesn't exist in earlier versions. This patch will allow
older versions of python installed alongside a standalone hashlib module
to work properly.
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6004 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rwxr-xr-x | src/lib/Client/Tools/rpmtools.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/Client/Tools/rpmtools.py b/src/lib/Client/Tools/rpmtools.py index c9385196f..e224a3fb3 100755 --- a/src/lib/Client/Tools/rpmtools.py +++ b/src/lib/Client/Tools/rpmtools.py @@ -21,19 +21,19 @@ __revision__ = '$Revision$' import grp -try: - import hashlib - py24compat = False -except: - # FIXME: Remove when client python dep is 2.5 or greater - py24compat = True - import md5 import optparse import os import pwd import rpm import stat import sys +if sys.version_info >= (2, 5): + import hashlib + py24compat = False +else: + # FIXME: Remove when client python dep is 2.5 or greater + py24compat = True + import md5 # Determine what prelink tools we have available. # The isprelink module is a python extension that examines the ELF headers |