[Freeipa-devel] [PATCH] 377 fix deprecation warning

Jason Gerard DeRose jderose at redhat.com
Fri Feb 12 19:57:08 UTC 2010


On Fri, 2010-02-12 at 10:56 -0500, Rob Crittenden wrote:
> Fix a deprecation warning importing sha.
> 
> rob

nack.  There is no `sha` attribute in the `hashlib` module; instead,
you'll need to use `hashlib.sha1`, like this:

    try:
        from hashlib import sha1 as sha
    except ImportError:
        from sha import sha

I'd like to start consolidating these Python compatibility hacks in the
`ipalib.compat` module.  But in the case of the `uuid` module, with its
funky imports inside of functions, we should probably keep our
modifications to a minimum.

So I agree with your approach.  ack once you fix the import.  ;)






More information about the Freeipa-devel mailing list