[Checkins] SVN: zc.recipe.cmmi/trunk/src/ Remove deprecation warnings for Python 2.6.
Tres Seaver
tseaver at palladion.com
Wed Mar 11 21:35:30 EDT 2009
Log message for revision 97945:
Remove deprecation warnings for Python 2.6.
Changed:
_U zc.recipe.cmmi/trunk/src/
U zc.recipe.cmmi/trunk/src/zc/recipe/cmmi/__init__.py
-=-
Property changes on: zc.recipe.cmmi/trunk/src
___________________________________________________________________
Added: svn:ignore
+ *.egg-info
Modified: zc.recipe.cmmi/trunk/src/zc/recipe/cmmi/__init__.py
===================================================================
--- zc.recipe.cmmi/trunk/src/zc/recipe/cmmi/__init__.py 2009-03-12 01:05:28 UTC (rev 97944)
+++ zc.recipe.cmmi/trunk/src/zc/recipe/cmmi/__init__.py 2009-03-12 01:35:29 UTC (rev 97945)
@@ -15,7 +15,10 @@
import logging, os, shutil, tempfile, urllib2, urlparse
import setuptools.archive_util
import datetime
-import sha
+try:
+ from hashlib import sha1
+except ImportError: # Python < 2.5
+ from sha import new as sha1
import shutil
import zc.buildout
@@ -125,7 +128,7 @@
def getFromCache(url, name, download_cache=None, install_from_cache=False):
if download_cache:
- cache_fname = sha.new(url).hexdigest()
+ cache_fname = sha1(url).hexdigest()
cache_name = os.path.join(download_cache, cache_fname)
if not os.path.isdir(download_cache):
os.mkdir(download_cache)
More information about the Checkins
mailing list