[Zope-dev] SVN: Zope/branches/gsoc-python-2.5/utilities/mkzopeinstance.py sha -> hashlib

Andreas Jung lists at zopyx.com
Tue Oct 14 13:08:28 EDT 2008


On 14.10.2008 19:03 Uhr, Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andreas Jung wrote:
>> Log message for revision 92197:
>>    sha ->  hashlib
>
> That needs to be a conditional import, with a fallback to the old sha
> module:  hashlib is not present in python 2.4.  E.g.:
>
> try:
>      import hashlib
> except ImportError: # Python<  2.5
>      import sha
>      _sha = sha.new
> else:
>      _sha = hashlib.sha1
>
> and then use '_sha' in the code.

Depends on which Python versions we want/must support for the future. 
One option would to jump on Python 2.6 for the next releases (skipping 
Python 2.5 and dropping Python 2.4 support).

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20081014/8a868325/attachment.vcf 


More information about the Zope-Dev mailing list