Mercurial > p > roundup > code
comparison roundup/anypy/hashlib_.py @ 4491:357c6079c73b
python2.4 compatibility fix
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Sat, 16 Apr 2011 18:38:18 +0000 |
| parents | eddb82d0964c |
| children |
comparison
equal
deleted
inserted
replaced
| 4490:559d9a2a0191 | 4491:357c6079c73b |
|---|---|
| 2 anypy.hashlib_: encapsulation of hashlib/md5/sha1/sha | 2 anypy.hashlib_: encapsulation of hashlib/md5/sha1/sha |
| 3 """ | 3 """ |
| 4 | 4 |
| 5 try: | 5 try: |
| 6 from hashlib import md5, sha1 # new in Python 2.5 | 6 from hashlib import md5, sha1 # new in Python 2.5 |
| 7 shamodule = sha1 | |
| 7 except ImportError: | 8 except ImportError: |
| 8 from md5 import md5 # deprecated in Python 2.6 | 9 from md5 import md5 # deprecated in Python 2.6 |
| 9 from sha import sha as sha1 # deprecated in Python 2.6 | 10 from sha import sha as sha1 # deprecated in Python 2.6 |
| 11 import sha as shamodule | |
| 10 | 12 |
| 11 # vim: ts=8 sts=4 sw=4 si | 13 # vim: ts=8 sts=4 sw=4 si |
