Commit 03d5ced3 authored by sidnei's avatar sidnei

- Conditionally import and use hashlib.md5 when it's available instead

  of md5 module, which is deprecated in Python 2.6.



git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@91889 62d5b8a3-27da-0310-9561-8e5933582275
parent 13bf8027
......@@ -7,6 +7,9 @@ Change History
1.1.2 (Unreleased)
==================
- Conditionally import and use hashlib.md5 when it's available instead
of md5 module, which is deprecated in Python 2.6.
- Added Jython support for bootstrap, development bootstrap
and zc.buildout support on Jython
......
......@@ -18,7 +18,6 @@ $Id$
import distutils.errors
import logging
import md5
import os
import pprint
import re
......@@ -36,6 +35,12 @@ import zc.buildout.easy_install
from rmtree import rmtree
try:
from hashlib import md5
except ImportError:
# Python 2.4 and older
from md5 import md5
realpath = zc.buildout.easy_install.realpath
pkg_resources_loc = pkg_resources.working_set.find(
......@@ -1202,7 +1207,7 @@ def _open(base, filename, seen):
ignore_directories = '.svn', 'CVS'
def _dir_hash(dir):
hash = md5.new()
hash = md5()
for (dirpath, dirnames, filenames) in os.walk(dir):
dirnames[:] = [n for n in dirnames if n not in ignore_directories]
filenames[:] = [f for f in filenames
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment