diff roundup/anypy/hashlib_.py @ 4089:eddb82d0964c

Add compatibility package to allow us to deal with Python versions 2.3..2.6. Outstanding issues noted in roundup/anypy/TODO.txt
author Richard Jones <richard@users.sourceforge.net>
date Thu, 12 Mar 2009 02:52:56 +0000
parents
children 357c6079c73b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roundup/anypy/hashlib_.py	Thu Mar 12 02:52:56 2009 +0000
@@ -0,0 +1,11 @@
+"""
+anypy.hashlib_: encapsulation of hashlib/md5/sha1/sha
+"""
+
+try:
+    from hashlib import md5, sha1 # new in Python 2.5
+except ImportError:
+    from md5 import md5           # deprecated in Python 2.6
+    from sha import sha as sha1   # deprecated in Python 2.6
+
+# vim: ts=8 sts=4 sw=4 si

Roundup Issue Tracker: http://roundup-tracker.org/