Comment 1 for bug 336891

Revision history for this message
Steven Knight (knight-baldmt) wrote :

Copying from the upstream bug report at scons.tigris.org:

The line of code you referenced is in a compatibility layer (SCons.compat) that
specifically wraps its import of md5 in an interface designed to mimic the
modern hashlib interface and for use only in older versions of Python. This
code is never used if the version of Python has a native hashlib module.

This is accomplished by the following snippet in
/usr/lib/scons/SCons/compat/__init__.py, which verifies that it can, in fact,
import the native hashlib module and only uses the module that imports md5 if
SCons is being run on an older version where the import fails:

try:
    import hashlib
except ImportError:
    # Pre-2.5 Python has no hashlib module.
    try:
        import_as('_scons_hashlib', 'hashlib')
    except ImportError:
        # If we failed importing our compatibility module, it probably
        # means this version of Python has no md5 module. Don't do
        # anything and let the higher layer discover this fact, so it
        # can fall back to using timestamp.
        pass

Closing as INVALID.