Commit b9138c32 authored by Jim Fulton's avatar Jim Fulton

tests (except for 1 that should fail) passing on Python (Mac OS X) 2.4-2.7, 3.2

parent 7b6fa058
......@@ -57,7 +57,10 @@ options, args = parser.parse_args()
# handle -S
def normpath(p):
return p[:-1] if p.endswith(os.path.sep) else p
if p.endswith(os.path.sep):
return p[:-1]
else:
return p
nosite = 'site' not in sys.modules
if nosite:
......
[buildout]
develop = zc.recipe.egg_ .
parts = test oltest py
versions = versions
[versions]
zope.interface = 3.8.0
zope.exceptions = 3.7.1
[py]
recipe = zc.recipe.egg
......
......@@ -30,7 +30,10 @@ if os.path.isdir('build'):
# handle -S
def normpath(p):
return p[:-1] if p.endswith(os.path.sep) else p
if p.endswith(os.path.sep):
return p[:-1]
else:
return p
nosite = 'site' not in sys.modules
if nosite:
......
......@@ -19,7 +19,11 @@ import zc.buildout.easy_install
no_site = zc.buildout.easy_install.no_site
from zc.buildout.rmtree import rmtree
from hashlib import md5
try:
from hashlib import md5
except ImportError:
from md5 import md5
try:
from UserDict import DictMixin
......@@ -729,8 +733,9 @@ class Buildout(DictMixin):
def _read_installed_part_options(self):
old = self['buildout']['installed']
if old and os.path.isfile(old):
with open(old) as fp:
fp = open(old)
sections = zc.buildout.configparser.parse(fp, old)
fp.close()
result = {}
for section, options in sections.items():
for option, value in options.items():
......
......@@ -181,6 +181,7 @@ class Download(object):
self.logger.info('Downloading %s' % url)
handle, tmp_path = tempfile.mkstemp(prefix='buildout-')
try:
try:
tmp_path, headers = urlretrieve(url, tmp_path)
if not check_md5sum(tmp_path, md5sum):
......
......@@ -1195,8 +1195,16 @@ runsetup_template = """
import sys
sys.path.insert(0, %(setupdir)r)
sys.path.insert(0, %(distribute)r)
nosite = 'site' not in sys.modules
original_path = sys.path[:]
import os, setuptools
if nosite and ('site' in sys.modules):
sys.path[:] = original_path
del sys.modules['site']
__file__ = %(__file__)r
os.chdir(%(setupdir)r)
......
......@@ -668,7 +668,11 @@ We have a link server that has a number of eggs:
For Python 2.5 and higher, you can also use the -m option to run a
module:
>>> print_(system(join(bin, 'py')+' -m pdb'), end='') # doctest: +ELLIPSIS
>>> if sys.version_info < (2, 5):
... print ('usage: pdb.py blah blah blah')
... else:
... print_(system(join(bin, 'py')+' -m pdb'), end='')
... # doctest: +ELLIPSIS
usage: pdb.py ...
>>> print_(system(join(bin, 'py')+' -m pdb what'), end='')
......
......@@ -42,7 +42,7 @@ def rmtree (path):
and make it unwriteable
>>> os.chmod (foo, 0o400)
>>> os.chmod (foo, 256) # 0400
rmtree should be able to remove it:
......
......@@ -404,7 +404,8 @@ def wait(port, up):
s.close()
if up:
break
except socket.error as e:
except socket.error:
e = sys.exc_info()[1]
if e[0] not in (errno.ECONNREFUSED, errno.ECONNRESET):
raise
s.close()
......
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