[Freeipa-devel] [PATCH] 377 fix deprecation warning
Rob Crittenden
rcritten at redhat.com
Fri Feb 12 22:08:58 UTC 2010
Jason Gerard DeRose wrote:
> 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. ;)
>
>
>
Gah, good catch. Fixed and pushed.
rob
More information about the Freeipa-devel
mailing list